WEBINARLive webinar: Terraform in Buddy, Oct 21st.Terraform: plan, approve, apply with state in Buddy. Live on October 21st.Save your seat

bdy sandbox exec

View as Markdown
$bdy sandbox exec [options] [command]

Run commands in a sandbox and manage them

OPTIONS
--context <name>
Connection and scope context: default, git, link or a saved name. Overrides the globally active context for this invocation.
--examples
Show only examples; with this flag --format accepts text, json or jsonl
--verbose
Show REST API requests, responses, timing and retries on stderr
-h, --help
display help for command
AVAILABLE COMMANDS
Execute a command in sandbox. Commands run as buddy with passwordless sudo. Use sudo for package installs Required scopes: SANDBOX_WRITE
Kill a running command Required scopes: SANDBOX_WRITE
List commands started in a sandbox Required scopes: SANDBOX_READ
Show the output of a command started with exec Required scopes: SANDBOX_READ
Show the status of a command started with exec Required scopes: SANDBOX_READ

Documentation for bdy v1.25.20

Last modified on Oct 14, 2026

Examples

Return the execution state using semantic exit codes
bdy sandbox exec command sandbox-identifier "echo hello" --exit-code$
Ran command in sandbox
bdy sb exec command sandbox-identifier "ls -la"$
Ran command in sandbox and wait for it to complete
bdy sb exec command sandbox-identifier "sleep 10" --wait$
Install package from apt
bdy sb exec command sandbox-identifier "sudo apt-get update && sudo apt-get install -y nginx" --wait$
Return log records as JSONL
bdy sandbox exec cmd my-sandbox "echo hello" --wait --format jsonl$
Kill command running in sandbox
bdy sb exec kill sandbox-identifier command-id$
Kill command running in sandbox and automatically confirm killing
bdy sb exec kill sandbox-identifier command-id -f$
List commands running in sandbox
bdy sb exec ls sandbox-identifier$
List commands running in sandbox in different project
bdy sb exec ls sandbox-identifier -p project$
Return the execution state using semantic exit codes
bdy sandbox exec logs sandbox-identifier command-id --exit-code$
Show logs from command
bdy sb exec logs sandbox-identifier command-id$
Show logs from command and wait for it to complete
bdy sb exec logs sandbox-identifier command-id --wait$
Return log records as JSONL
bdy sandbox exec logs my-sandbox command-id --wait --format jsonl$
Return the execution state using semantic exit codes
bdy sandbox exec status sandbox-identifier command-id --exit-code$
Show status of command
bdy sb exec status sandbox-identifier command-id$
Show status of command in sandbox from another workspace
bdy sb exec status sandbox-identifier command-id -w workspace -p project$