Documentation Index
Fetch the complete documentation index at: https://docs.declaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
sbx.Commands is the *Commands sub-object available on every Sandbox instance. It provides methods to run foreground commands, launch background processes, and list running processes.
sbx.Commands.Run()
Run a command and block until it completes, returning stdout, stderr, and exit code.
Run returns both the *CommandResult and a *CommandExitError. You can inspect the result even on failure:
Shell command to execute inside the sandbox.
Additional environment variables for this command.
Unix user to run the command as. Server defaults to
"user" when not specified.Working directory. Defaults to the user’s home directory.
Callback invoked for each line of stdout after the command completes.
Callback invoked for each line of stderr after the command completes.
Enables stdin for the command, allowing data to be sent via
SendStdin.Maximum time to wait for the command to complete.
(*CommandResult, error)
sbx.Commands.Start()
Start a command in the background and return a *CommandHandle immediately.
Shell command to execute.
Run().
Returns (*CommandHandle, error)
sbx.Commands.List()
List all running processes in the sandbox.
([]ProcessInfo, error)
CommandHandle
CommandHandle is returned by sbx.Commands.Start(). It provides methods to wait for or kill the process.
handle.Wait()
Block until the background command completes.
(*CommandResult, error) — returns *CommandExitError on non-zero exit.
handle.Kill()
Kill the process by PID.
handle.PID
Type int — the process ID.
handle.SendStdin()
Write data to the stdin of a running background process.
Not yet implemented. Returns an error until server-side support is available.
Data to write to stdin. Include
\n for newlines.error