The Go SDK exposes stdio throughDocumentation Index
Fetch the complete documentation index at: https://docs.declaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
sandbox.Stdio. Use
Stdio.Start() to launch a process with an open stdin pipe, then
send data, receive output, and close stdin or kill the process.
For conceptual background see the
Stdio feature overview.
sandbox.Stdio.Start(ctx, cmd, opts) → (*StdioHandle, error)
Start a subprocess with an open stdin pipe.
StdioStartOpts
| Field | Type | Default | Description |
|---|---|---|---|
User | string | "user" | User the process runs as. |
Cwd | string | "" | Working directory. |
Envs | map[string]string | nil | Environment variables merged into the process env. |
nil for opts to use all defaults.
StdioHandle
Handle for an interactive subprocess with stdin pipe.
Fields
handle.CmdID string— server-assigned command identifier.
Methods
handle.SendStdin(ctx, data) error
Send data to the process’s stdin. Data is []byte.
handle.CloseStdin(ctx) error
Close the process’s stdin pipe, sending EOF.
handle.Kill(ctx) error
Terminate the process.
handle.Wait(ctx) (*StdioResult, error)
Block until the process exits. Equivalent to calling Stream with no
callbacks.
handle.Stream(ctx, opts) (*StdioResult, error)
Connect to the SSE output stream and deliver stdout/stderr chunks via
callbacks. Blocks until the process exits or the context is cancelled.
StdioStreamOpts
| Field | Type | Description |
|---|---|---|
OnStdout | func(data []byte) | Callback invoked for each stdout chunk. |
OnStderr | func(data []byte) | Callback invoked for each stderr chunk. |
nil for opts to drain the stream without callbacks (same as Wait).
StdioResult
ExitCode is -1 if the stream ended without a clean exit frame.