sandbox

package
v0.6.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSSHKey

func AddSSHKey(ctx context.Context, client *circleci.Client, sandboxID, publicKey, publicKeyFile string) (*circleci.AddSSHKeyResponse, error)

func Create

func Create(ctx context.Context, client *circleci.Client, orgID, name, image string) (*circleci.Sandbox, error)

func Exec

func Exec(ctx context.Context, client *circleci.Client, sandboxID, command string, args []string) (*circleci.ExecResponse, error)

func List

func List(ctx context.Context, client *circleci.Client, orgID string) ([]circleci.Sandbox, error)

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 string, args []string, io iostream.Streams) error

SSH opens a session and executes a command over SSH.

func ShellEscape

func ShellEscape(arg string) string

ShellEscape escapes a string for safe use in a POSIX shell single-quoted context.

func ShellJoin

func ShellJoin(args []string) string

ShellJoin joins args into a shell command string with POSIX single-quote escaping.

func Sync

func Sync(ctx context.Context, client *circleci.Client, sandboxID, identityFile, dest string, bootstrap bool, io iostream.Streams) error

Sync synchronises local changes to a sandbox over SSH. If bootstrap is true it clones the repo on the sandbox first.

Types

type ExecResult

type ExecResult struct {
	Stdout   string
	Stderr   string
	ExitCode int
}

ExecResult holds the output of a command executed over SSH.

func ExecOverSSH

func ExecOverSSH(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
	KnownHosts   string // path to known_hosts file
}

Session holds the info needed to SSH into a sandbox.

func OpenSession

func OpenSession(ctx context.Context, client *circleci.Client, sandboxID, identityFile string) (*Session, error)

OpenSession registers an SSH key with the sandbox and returns session info.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL