Documentation
¶
Index ¶
- func AddSSHKey(ctx context.Context, client *circleci.Client, ...) (*circleci.AddSSHKeyResponse, error)
- func Create(ctx context.Context, client *circleci.Client, orgID, name, image string) (*circleci.Sandbox, error)
- func Exec(ctx context.Context, client *circleci.Client, sandboxID, command string, ...) (*circleci.ExecResponse, error)
- func InteractiveShell(ctx context.Context, session *Session) error
- func List(ctx context.Context, client *circleci.Client, orgID string) ([]circleci.Sandbox, error)
- func Prepare(ctx context.Context, claude *anthropic.Client, dockerSudo bool, ...) error
- func SSH(ctx context.Context, client *circleci.Client, ...) error
- func ShellEscape(arg string) string
- func ShellJoin(args []string) string
- func Sync(ctx context.Context, client *circleci.Client, ...) error
- type ExecResult
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InteractiveShell ¶ added in v0.7.1
InteractiveShell opens an interactive shell session to the sandbox with PTY.
func Prepare ¶
func Prepare(ctx context.Context, claude *anthropic.Client, dockerSudo bool, io iostream.Streams, stdin io.Reader) error
Prepare generates a Dockerfile, builds it, and runs tests inside the container.
func SSH ¶
func SSH(ctx context.Context, client *circleci.Client, sandboxID, identityFile, authSock string, args []string, io iostream.Streams) error
SSH opens a session and either runs a command or starts an interactive shell.
func ShellEscape ¶
ShellEscape escapes a string for safe use in a POSIX shell single-quoted context.
Types ¶
type ExecResult ¶
ExecResult holds the output of a command executed over SSH.
func ExecOverSSH ¶
func ExecOverSSH(ctx context.Context, session *Session, command string, stdin io.Reader) (*ExecResult, error)
ExecOverSSH connects to the sandbox via SSH-over-TLS and executes a command.
type Session ¶
type Session struct {
URL string // sandbox domain
IdentityFile string // path to SSH private key (empty when using agent)
KnownHosts string // path to known_hosts file
UseAgent bool // true when authenticating via ssh-agent
AuthSock string // SSH_AUTH_SOCK path (only used when UseAgent is true)
}
Session holds the info needed to SSH into a sandbox.
func OpenSession ¶
func OpenSession(ctx context.Context, client *circleci.Client, sandboxID, identityFile, authSock string) (*Session, error)
OpenSession registers an SSH key with the sandbox and returns session info. authSock is the SSH_AUTH_SOCK path; when non-empty and no identityFile is given, the agent is tried first.