Versions in this module Expand all Collapse all v0 v0.1.3 Jun 9, 2026 Changes in this version + const DefaultUser + const MCPPort type Client + func (c *Client) DeleteSnapshot(ctx context.Context, snapshotID string) (bool, error) + func (c *Client) ListAllSnapshots(ctx context.Context, opts SnapshotListOptions) ([]SnapshotInfo, error) + func (c *Client) ListSnapshots(_ context.Context, opts SnapshotListOptions) *SnapshotPaginator type Filesystem + func (f *Filesystem) WriteFiles(ctx context.Context, entries []WriteEntry, opts FsOptions) ([]WriteInfo, error) type FsOptions + Depth int + type MetricsOptions struct + End time.Time + Start time.Time type Sandbox + func (s *Sandbox) GetMcpToken(ctx context.Context) (string, error) + func (s *Sandbox) GetMcpURL() string + type SnapshotListOptions struct + Limit int32 + NextToken string + SandboxID string + type SnapshotPaginator struct + func (p *SnapshotPaginator) HasNext() bool + func (p *SnapshotPaginator) NextItems(ctx context.Context) ([]SnapshotInfo, error) + func (p *SnapshotPaginator) NextToken() string + type WriteEntry struct + Data []byte + Path string v0.1.2 Jun 4, 2026 Changes in this version + type Client struct + func NewClient(cfg Config) (*Client, error) + func (c *Client) Config() Config + func (c *Client) Connect(ctx context.Context, sandboxID string, opts ConnectOptions) (*Sandbox, error) + func (c *Client) Create(ctx context.Context, opts CreateOptions) (*Sandbox, error) + func (c *Client) Kill(ctx context.Context, sandboxID string) (bool, error) + func (c *Client) List(_ context.Context, opts SandboxListOptions) *SandboxPaginator + func (c *Client) ListAll(ctx context.Context, opts SandboxListOptions) ([]SandboxInfo, error) type SandboxInfo + func ListAll(ctx context.Context, cfg Config, opts SandboxListOptions) ([]SandboxInfo, error) + type SandboxListOptions struct + Limit int32 + Metadata map[string]string + NextToken string + State []SandboxState + type SandboxPaginator struct + func List(ctx context.Context, cfg Config, opts SandboxListOptions) (*SandboxPaginator, error) + func (p *SandboxPaginator) HasNext() bool + func (p *SandboxPaginator) NextItems(ctx context.Context) ([]SandboxInfo, error) + func (p *SandboxPaginator) NextToken() string v0.1.1 Apr 29, 2026 Changes in this version + const AllTraffic + const DefaultDomain + const DefaultRequestTimeout + const DefaultSandboxTimeout + const DefaultTemplate + const KeepAlivePingHeader + const KeepAlivePingIntervalSec + const SDKVersion + const UpstreamTag + var ErrNotImplemented = errors.New("e2b: not implemented") + var ErrTemplate = errors.New("template error") + var ErrTemplateBuild = errors.New("template build failed") + var ErrTemplateUpload = errors.New("template file upload failed") + func Kill(ctx context.Context, sandboxID string, opts ConnectOptions) (bool, error) + type AuthenticationError struct + Message string + func (e *AuthenticationError) Error() string + type BuildError struct + Cause error + Message string + func (e *BuildError) Error() string + func (e *BuildError) Unwrap() error + type CommandExitError struct + Result CommandResult + func (e *CommandExitError) Error() string + type CommandHandle struct + func (h *CommandHandle) Kill(ctx context.Context) (bool, error) + func (h *CommandHandle) PID() uint32 + func (h *CommandHandle) PtyOutput() <-chan []byte + func (h *CommandHandle) SendStdin(ctx context.Context, data []byte) error + func (h *CommandHandle) Stderr() <-chan []byte + func (h *CommandHandle) Stdout() <-chan []byte + func (h *CommandHandle) Wait(ctx context.Context) (*CommandResult, error) + type CommandResult struct + Error string + ExitCode int32 + Stderr string + Stdout string + type Commands struct + func (c *Commands) CloseStdin(ctx context.Context, pid uint32) error + func (c *Commands) Connect(ctx context.Context, pid uint32) (*CommandHandle, error) + func (c *Commands) Kill(ctx context.Context, pid uint32) (bool, error) + func (c *Commands) List(ctx context.Context) ([]ProcessInfo, error) + func (c *Commands) Run(ctx context.Context, cmd string, opts RunOptions) (*CommandHandle, error) + func (c *Commands) SendStdin(ctx context.Context, pid uint32, data []byte) error + func (c *Commands) Start(ctx context.Context, cmd string, opts RunOptions) (*CommandHandle, error) + type Config struct + APIKey string + APIURL string + AccessToken string + Debug bool + Domain string + ExtraSandboxHeaders map[string]string + HTTPClient *http.Client + Headers map[string]string + RequestTimeout time.Duration + RequestTimeoutDisabled bool + SandboxURL string + func (c Config) Resolve() Config + func (c Config) ResolvedHTTPClient() *http.Client + type ConnectOptions struct + Config Config + Timeout time.Duration + type CreateOptions struct + AllowInternetAccess bool + AllowInternetAccessSet bool + Config Config + Envs map[string]string + Lifecycle *LifecycleOptions + Mcp map[string]any + Metadata map[string]string + Network *NetworkOptions + Secure bool + Template string + Timeout time.Duration + VolumeMounts []VolumeMount + type EntryInfo struct + Group string + Mode uint32 + ModifiedTime time.Time + Name string + Owner string + Path string + Permissions string + Size int64 + SymlinkTarget string + Type EntryType + type EntryType int + const EntryTypeDirectory + const EntryTypeFile + const EntryTypeUnspecified + type Error interface + type FileNotFoundError struct + Message string + Path string + func (e *FileNotFoundError) Error() string + type FileUploadError struct + Cause error + Message string + Path string + func (e *FileUploadError) Error() string + func (e *FileUploadError) Unwrap() error + type Filesystem struct + func (f *Filesystem) Exists(ctx context.Context, path string, opts FsOptions) (bool, error) + func (f *Filesystem) IsDir(ctx context.Context, path string, opts FsOptions) (bool, error) + func (f *Filesystem) List(ctx context.Context, path string, opts FsOptions) ([]EntryInfo, error) + func (f *Filesystem) MakeDir(ctx context.Context, path string, opts FsOptions) error + func (f *Filesystem) Move(ctx context.Context, from, to string, opts FsOptions) error + func (f *Filesystem) Read(ctx context.Context, path string, opts FsOptions) ([]byte, error) + func (f *Filesystem) ReadStream(ctx context.Context, path string, opts FsOptions) (io.ReadCloser, error) + func (f *Filesystem) Remove(ctx context.Context, path string, opts FsOptions) error + func (f *Filesystem) Stat(ctx context.Context, path string, opts FsOptions) (*EntryInfo, error) + func (f *Filesystem) Watch(ctx context.Context, path string, recursive bool) (*WatchHandle, error) + func (f *Filesystem) Write(ctx context.Context, path string, r io.Reader, opts FsOptions) (*WriteInfo, error) + func (f *Filesystem) WriteString(ctx context.Context, path, data string, opts FsOptions) (*WriteInfo, error) + type FilesystemEvent struct + Name string + Type FilesystemEventType + type FilesystemEventType int + const FsEventChmod + const FsEventCreate + const FsEventRemove + const FsEventRename + const FsEventUnspecified + const FsEventWrite + type FsOptions struct + RequestTimeoutMs int + User string + type Git struct + func (g *Git) Add(ctx context.Context, pattern string, opts GitOptions) (*CommandResult, error) + func (g *Git) Branches(ctx context.Context, opts GitOptions) (*GitBranches, error) + func (g *Git) CheckoutBranch(ctx context.Context, name string, opts GitOptions) (*CommandResult, error) + func (g *Git) Clone(ctx context.Context, url string, opts GitCloneOptions) (*CommandResult, error) + func (g *Git) Commit(ctx context.Context, message string, opts GitOptions) (*CommandResult, error) + func (g *Git) CreateBranch(ctx context.Context, name string, opts GitOptions) (*CommandResult, error) + func (g *Git) DeleteBranch(ctx context.Context, name string, opts GitOptions) (*CommandResult, error) + func (g *Git) GetRemoteURL(ctx context.Context, name string, opts GitOptions) (string, error) + func (g *Git) Pull(ctx context.Context, opts GitOptions) (*CommandResult, error) + func (g *Git) Push(ctx context.Context, opts GitOptions) (*CommandResult, error) + func (g *Git) SetRemoteURL(ctx context.Context, name, url string, opts GitOptions) (*CommandResult, error) + func (g *Git) Status(ctx context.Context, opts GitOptions) (*GitStatus, error) + type GitAuthError struct + Message string + func (e *GitAuthError) Error() string + type GitBranches struct + Current string + Local []string + Remote []string + type GitCloneOptions struct + Branch string + DangerouslyStoreCredentials bool + Depth int + Password string + Username string + type GitOptions struct + Cwd string + Envs map[string]string + RepoPath string + User string + type GitStatus struct + Modified []string + Staged []string + Untracked []string + type GitUpstreamError struct + Message string + func (e *GitUpstreamError) Error() string + type InvalidArgumentError struct + Message string + func (e *InvalidArgumentError) Error() string + type LifecycleOptions struct + AutoResume bool + OnTimeout string + type NetworkOptions struct + AllowOut []string + AllowPublicTraffic bool + DenyOut []string + MaskRequestHost string + type NotEnoughSpaceError struct + Message string + func (e *NotEnoughSpaceError) Error() string + type NotFoundError struct + Message string + func (e *NotFoundError) Error() string + type ProcessInfo struct + Args []string + Cmd string + Cwd string + Envs map[string]string + PID uint32 + Tag string + type Pty struct + func (p *Pty) Create(ctx context.Context, opts PtyOptions) (*CommandHandle, error) + func (p *Pty) Kill(ctx context.Context, pid uint32) (bool, error) + func (p *Pty) Resize(ctx context.Context, pid uint32, cols, rows uint32) error + func (p *Pty) SendInput(ctx context.Context, pid uint32, data []byte) error + type PtyOptions struct + Args []string + Cmd string + Cols uint32 + Cwd string + Envs map[string]string + OnData func([]byte) + Rows uint32 + Tag string + type RateLimitError struct + Message string + func (e *RateLimitError) Error() string + type RunOptions struct + Args []string + Background bool + Cwd string + Envs map[string]string + OnStderr func([]byte) + OnStdout func([]byte) + Stdin io.Reader + Tag string + TimeoutMs int + User string + type Sandbox struct + Commands *Commands + Domain string + EnvdAccessToken string + EnvdVersion string + Files *Filesystem + Git *Git + ID string + Pty *Pty + TrafficAccessToken string + func Connect(ctx context.Context, sandboxID string, opts ConnectOptions) (*Sandbox, error) + func Create(ctx context.Context, opts CreateOptions) (*Sandbox, error) + func (s *Sandbox) CreateSnapshot(ctx context.Context) (*SnapshotInfo, error) + func (s *Sandbox) DownloadURL(path string, opts SignatureOptions) (string, error) + func (s *Sandbox) GetHost(port int) string + func (s *Sandbox) GetInfo(ctx context.Context) (*SandboxInfo, error) + func (s *Sandbox) GetMetrics(ctx context.Context) ([]SandboxMetric, error) + func (s *Sandbox) IsRunning(ctx context.Context) (bool, error) + func (s *Sandbox) Kill(ctx context.Context) error + func (s *Sandbox) Pause(ctx context.Context) (bool, error) + func (s *Sandbox) SetTimeout(ctx context.Context, d time.Duration) error + func (s *Sandbox) UploadURL(path string, opts SignatureOptions) (string, error) + type SandboxError struct + Cause error + Message string + func (e *SandboxError) Error() string + func (e *SandboxError) Unwrap() error + type SandboxInfo struct + Alias string + AllowInternetAccess *bool + CPUCount int32 + DiskSizeMB int32 + Domain string + EndAt time.Time + EnvdAccessToken string + EnvdVersion string + Lifecycle *LifecycleOptions + MemoryMB int32 + Metadata map[string]string + Network *NetworkOptions + SandboxID string + StartedAt time.Time + State SandboxState + TemplateID string + VolumeMounts []VolumeMount + type SandboxMetric struct + CPUCount int32 + CPUUsedPct float32 + DiskTotal int64 + DiskUsed int64 + MemTotal int64 + MemUsed int64 + Timestamp time.Time + TimestampUnix int64 + type SandboxNotFoundError struct + Message string + SandboxID string + func (e *SandboxNotFoundError) Error() string + type SandboxState string + const SandboxStatePaused + const SandboxStateRunning + type Signature struct + Expiration *int64 + Value string + func GetSignature(path string, operation SignatureOperation, envdAccessToken string, ...) (Signature, error) + type SignatureOperation string + const SignatureRead + const SignatureWrite + type SignatureOptions struct + ExpirationInSeconds int + User string + type SnapshotInfo struct + Names []string + SnapshotID string + type TemplateError struct + Message string + func (e *TemplateError) Error() string + type TimeoutError struct + Cause error + Message string + func (e *TimeoutError) Error() string + func (e *TimeoutError) Temporary() bool + func (e *TimeoutError) Timeout() bool + func (e *TimeoutError) Unwrap() error + type VolumeError struct + Cause error + Message string + func (e *VolumeError) Error() string + func (e *VolumeError) Unwrap() error + type VolumeMount struct + Name string + Path string + type WatchHandle struct + func (w *WatchHandle) Err() error + func (w *WatchHandle) Events() <-chan FilesystemEvent + func (w *WatchHandle) Stop(ctx context.Context) error + type WriteInfo struct + Name string + Path string + Type EntryType v0.1.0 Apr 29, 2026