Versions in this module Expand all Collapse all v0 v0.2.0 Jul 17, 2026 Changes in this version + var ErrMissingKey = errors.New("xshellz: missing private key for existing sandbox") + var ErrUnsupportedLanguage = errors.New("xshellz: unsupported RunCode language") + func DefaultKeystoreDir() (string, error) + func GetBoxfile(ctx context.Context, opts *ConnectOptions) (string, error) + func SetBoxfile(ctx context.Context, manifest string, opts *ConnectOptions) (string, error) + func SupportedLanguages() []string + type GetOrCreateOptions struct + APIKey string + APIURL string + DisableKeystore bool + KeystoreDir string + PrivateKeyPEM []byte + type Job struct + ID string + LogPath string + PID int + Running bool + type JobHandle struct + ID string + LogPath string + PID int + func (j *JobHandle) IsRunning(ctx context.Context) (bool, error) + func (j *JobHandle) Logs(ctx context.Context, tailLines int) (string, error) + func (j *JobHandle) Stop(ctx context.Context) error + type ProcessInfo struct + CPU float64 + Comm string + Mem float64 + PID int type Sandbox + func GetOrCreate(ctx context.Context, name string, opts *GetOrCreateOptions) (*Sandbox, error) + func (s *Sandbox) Jobs(ctx context.Context) ([]Job, error) + func (s *Sandbox) Kill(ctx context.Context) error + func (s *Sandbox) Procs(ctx context.Context) (*SandboxProcs, error) + func (s *Sandbox) Restart(ctx context.Context) error + func (s *Sandbox) RunCode(ctx context.Context, language, code string, opts *RunOptions) (*RunResult, error) + func (s *Sandbox) Spawn(ctx context.Context, cmd string, opts *SpawnOptions) (*JobHandle, error) + func (s *Sandbox) Stats(ctx context.Context) (*SandboxStats, error) + func (s *Sandbox) TerminalURL(ctx context.Context) (string, error) + type SandboxProcs struct + Agents []string + DiskAllowedMB int + DiskUsedMB int + Procs []ProcessInfo + Sessions int + type SandboxStats struct + BlkReadMB int + BlkWriteMB int + CPUAllowedVCPUs float64 + CPUPercent float64 + CPUThrottledPeriods int + DiskAllowedMB int + DiskUsedMB int + MemAllowedMB int + MemLimitMB int + MemUsedMB int + NetRxMB int + NetTxMB int + PidsAllowed int + PidsCurrent int + type SpawnOptions struct + Name string v0.1.0 Jul 16, 2026 Changes in this version + const DefaultAPIURL + const StatusCreating + const StatusRunning + const StatusStopped + var ErrAuth = errors.New("xshellz: authentication or permission denied") + var ErrNoAPIKey = errors.New(...) + var ErrNotFound = errors.New("xshellz: sandbox not found") + var ErrNotRunning = errors.New("xshellz: sandbox is not running (call Start to resume a stopped box)") + var ErrQuota = errors.New(...) + type APIError struct + Body string + Code string + Message string + StatusCode int + func (e *APIError) Error() string + func (e *APIError) Unwrap() error + type ConnectOptions struct + APIKey string + APIURL string + type CreateOptions struct + APIKey string + APIURL string + Name string + type RunOptions struct + Cwd string + Env map[string]string + Stderr io.Writer + Stdout io.Writer + type RunResult struct + ExitCode int + Stderr string + Stdout string + type Sandbox struct + func Connect(ctx context.Context, uuid string, privateKeyPEM []byte, opts *ConnectOptions) (*Sandbox, error) + func Create(ctx context.Context, opts *CreateOptions) (*Sandbox, error) + func (s *Sandbox) Close(ctx context.Context) error + func (s *Sandbox) Detach() + func (s *Sandbox) Download(ctx context.Context, remotePath, localPath string) error + func (s *Sandbox) Info() SandboxInfo + func (s *Sandbox) PrivateKeyPEM() []byte + func (s *Sandbox) ReadFile(ctx context.Context, remotePath string) ([]byte, error) + func (s *Sandbox) Run(ctx context.Context, cmd string, opts *RunOptions) (*RunResult, error) + func (s *Sandbox) SSHCommand() string + func (s *Sandbox) SSHHost() string + func (s *Sandbox) SSHPort() int + func (s *Sandbox) Start(ctx context.Context) error + func (s *Sandbox) Status() string + func (s *Sandbox) UUID() string + func (s *Sandbox) Upload(ctx context.Context, localPath, remotePath string) error + func (s *Sandbox) WriteFile(ctx context.Context, remotePath string, data []byte) error + type SandboxInfo struct + AlwaysOn bool + CreatedAt string + Gvisor bool + Isolation string + Name string + SSHCommand string + SSHHost string + SSHPort int + SpawnedAt string + Status string + TrialHoursRemaining float64 + UUID string + WebTerminalReady bool + func List(ctx context.Context, opts *ConnectOptions) ([]SandboxInfo, error)