Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/opensandbox-group/OpenSandbox/llms.txt

Use this file to discover all available pages before exploring further.

The osb CLI is organized into command groups, each covering a distinct area of sandbox management. This reference lists every command with its flags, arguments, and working examples drawn directly from the source. All examples assume you have already configured the CLI with osb config init — see the CLI Overview for setup instructions.

Global Flags

These flags apply to the root osb command and override any config file or environment variable setting for the current invocation.
FlagDescription
--api-keyOverride the API key for authentication (OPEN_SANDBOX_API_KEY env var).
--domainOverride the server domain (e.g. localhost:8080) (OPEN_SANDBOX_DOMAIN env var).
--protocolProtocol to use: http or https.
--request-timeoutHTTP request timeout in seconds (integer).
--use-server-proxy / --no-use-server-proxyRoute execd and endpoint traffic through the sandbox server proxy.
--configPath to an alternate config file.
-v, --verboseEnable verbose/debug output.
--no-colorDisable colored output.
The output format flag -o / --output is per-command, not global. Pass it after the subcommand name (e.g. osb sandbox list -o json).

osb sandbox

Create a new sandbox from a container image. The image is required unless you have set defaults.image in the config file.
osb sandbox create --image python:3.12 --timeout 30m -o json
Flags:
FlagDescription
--image, -iContainer image (e.g. python:3.12). Uses defaults.image from config if omitted.
--timeout, -tSandbox lifetime: duration like 10m or 1h, none for manual cleanup, or omit to use config/SDK default.
--entrypointEntrypoint argv item. Repeat to build the full list.
--env, -eEnvironment variable as KEY=VALUE. Repeatable.
--metadata, -mMetadata key-value pair as KEY=VALUE. Repeatable.
--extensionExtension parameter as KEY=VALUE. Repeatable.
--resourceResource limit as KEY=VALUE (e.g. cpu=1, memory=2Gi). Repeatable.
--image-auth-usernameRegistry username for a private image.
--image-auth-passwordRegistry password or token for a private image.
--network-policy-filePath to a network policy JSON file.
--volumes-filePath to a volumes JSON file (list of volume objects).
--credential-proxyEnable Credential Vault transparent proxy. Requires --network-policy-file.
--skip-health-checkSkip waiting for sandbox readiness.
--ready-timeoutMax time to wait for readiness (e.g. 30s).
Examples:
osb sandbox create --image python:3.12
If you set config defaults first, subsequent create commands can omit the flags:
osb config set defaults.image python:3.12
osb config set defaults.timeout 30m
osb sandbox create -o json
List sandboxes, optionally filtered by state, metadata, or page.
osb sandbox list
osb sandbox list -o json
osb sandbox list --state running --state paused
FlagDescription
--state, -sFilter by sandbox state (e.g. running, paused). Case-insensitive. Repeatable.
--metadata, -mMetadata filter as KEY=VALUE. Repeatable.
--pagePage number (1-indexed).
--page-sizeItems per page.
Fetch full details for a specific sandbox by ID.
osb sandbox get <sandbox-id> -o json
ArgumentDescription
sandbox-idThe sandbox ID returned by sandbox create or sandbox list.
Terminate one or more sandboxes immediately.
osb sandbox kill <sandbox-id>
osb sandbox kill <sandbox-id> -o json
osb sandbox kill <sandbox-id-1> <sandbox-id-2> -o json
Multiple sandbox IDs are accepted in a single call.
Pause a running sandbox, preserving its state for later resumption.
osb sandbox pause <sandbox-id>
osb sandbox pause <sandbox-id> -o json
Resume a previously paused sandbox.
osb sandbox resume <sandbox-id>
osb sandbox resume <sandbox-id> -o json
FlagDescription
--skip-health-checkSkip waiting for sandbox readiness after resume.
--resume-timeoutMax time to wait for readiness after resume (e.g. 30s).
Extend the expiration time of a sandbox.
osb sandbox renew <sandbox-id> --timeout 1h -o json
FlagDescription
--timeout, -tRequired. New TTL duration (e.g. 30m, 2h).
Check whether a sandbox is healthy and ready to accept commands.
osb sandbox health <sandbox-id>
osb sandbox health <sandbox-id> -o json
Retrieve resource usage metrics for a running sandbox.
osb sandbox metrics <sandbox-id>
osb sandbox metrics <sandbox-id> --watch -o raw
FlagDescription
--watchStream metrics updates in real time.
Get the public network endpoint URL for a port exposed by the sandbox.
osb sandbox endpoint <sandbox-id> --port 8080 -o json
FlagDescription
--port, -pRequired. The port number to resolve to an endpoint URL.

osb command

Run a command inside a sandbox. Always use -- to separate osb flags from the sandbox command payload.Foreground (default): streams stdout and stderr directly to your terminal. Only -o raw is accepted.
osb command run <sandbox-id> -o raw -- python -c "print(1 + 1)"
osb command run <sandbox-id> -o raw -- sh -lc 'echo ready'
Background: returns a tracked execution object immediately. Accepts -o table, json, or yaml.
osb command run <sandbox-id> --background -o json -- sh -c "sleep 10; echo done"
FlagDescription
--background, -dRun in background and return an execution ID.
--workdir, -wWorking directory inside the sandbox.
--timeout, -tCommand timeout (e.g. 30s, 5m).
Check the status of a background command execution.
osb command status <sandbox-id> <execution-id> -o json
Retrieve logs from a background command execution.
osb command logs <sandbox-id> <execution-id> -o json
osb command logs <sandbox-id> <execution-id> -o raw
FlagDescription
--cursorInteger cursor for incremental log reads.
Interrupt a running foreground or background command.
osb command interrupt <sandbox-id> <execution-id>
Persistent shell sessions maintain environment state — exported variables, working directory changes, and shell history — across multiple session run calls.
# Create a session
osb command session create <sandbox-id> --workdir /workspace -o json

# Run commands in the session (state is preserved between calls)
osb command session run <sandbox-id> <session-id> -o raw -- pwd
osb command session run <sandbox-id> <session-id> -o raw -- export FOO=bar
osb command session run <sandbox-id> <session-id> -o raw -- sh -c 'echo $FOO'

# Delete the session when finished
osb command session delete <sandbox-id> <session-id> -o json
session create flags:
FlagDescription
--workdir, -wInitial working directory for the session.
session run flags:
FlagDescription
--workdir, -wWorking directory override for this run.
--timeout, -tCommand timeout (e.g. 30s, 5m).

osb file

Write content to a file in the sandbox. Pass content inline with -c or pipe it from stdin.
osb file write <sandbox-id> /workspace/hello.txt -c "hello" -o json
Reading from stdin:
cat local-script.py | osb file write <sandbox-id> /workspace/script.py
FlagDescription
--content, -cContent to write. Reads from stdin if omitted.
--encodingFile encoding (default: utf-8).
--modePermission mode as an integer (e.g. 644, 755).
--ownerFile owner.
--groupFile group.
Read and print a file from the sandbox.
osb file cat <sandbox-id> /workspace/hello.txt -o raw
FlagDescription
--encodingFile encoding (default: utf-8).
-oOnly raw is supported.
Upload a local file to a path inside the sandbox.
osb file upload <sandbox-id> ./local.txt /workspace/local.txt -o json
ArgumentDescription
local_pathPath to the local file (must exist).
remote_pathDestination path inside the sandbox.
Download a file from the sandbox to local disk.
osb file download <sandbox-id> /workspace/result.json ./result.json -o json
ArgumentDescription
remote_pathSource path inside the sandbox.
local_pathDestination path on the local filesystem.
Get metadata (size, permissions, modification time) for one or more sandbox paths.
osb file info <sandbox-id> /workspace/main.py -o json
osb file info <sandbox-id> /workspace/main.py /workspace/utils.py -o json
Multiple paths are accepted in a single call.
Change permissions on a file in the sandbox.
osb file chmod <sandbox-id> /workspace/script.sh --mode 755 -o json
FlagDescription
--modeRequired. Permission mode as an integer (e.g. 755, 644).
--ownerFile owner.
--groupFile group.
Replace a string within a file in place.
osb file replace <sandbox-id> /workspace/app.py --old "old_value" --new "new_value" -o json
FlagDescription
--oldRequired. The string to search for.
--newRequired. The replacement string.
Delete one or more files, or move/rename a file.
# Delete one or more files
osb file rm <sandbox-id> /workspace/temp.txt
osb file rm <sandbox-id> /workspace/a.txt /workspace/b.txt

# Move or rename
osb file mv <sandbox-id> /workspace/old-name.py /workspace/new-name.py
Create or remove directories inside the sandbox.
# Create one or more directories
osb file mkdir <sandbox-id> /workspace/output /workspace/logs

# Remove one or more directories
osb file rmdir <sandbox-id> /workspace/output
file mkdir flags:
FlagDescription
--modeDirectory permission mode as an integer.
--ownerDirectory owner.
--groupDirectory group.

osb egress

Retrieve the current runtime egress policy for a sandbox.
osb egress get <sandbox-id> -o json
Patch egress rules at runtime using merge semantics. Rules are specified as ACTION=TARGET pairs.
osb egress patch <sandbox-id> --rule allow=pypi.org --rule deny=internal.example.com -o json
FlagDescription
--ruleRequired. Rule in allow=TARGET or deny=TARGET form. Repeatable.
Verify the change takes effect by running a connectivity test inside the sandbox:
osb command run <sandbox-id> -o raw -- curl -I https://pypi.org

osb diagnostics

--scope is required for all diagnostics commands. Common scopes for logs are lifecycle (manager logs) and container (sandbox stdout). Common scopes for events are lifecycle and runtime.
Some server builds may return DIAGNOSTICS_NOT_IMPLEMENTED for scoped diagnostics until the stable backend implementation is enabled. Prefer osb diagnostics over osb devops for all stable API-backed log and event collection.
Retrieve diagnostic logs for a sandbox.
osb diagnostics logs <sandbox-id> --scope container -o raw
osb diagnostics logs <sandbox-id> --scope lifecycle -o json
osb diagnostics logs <sandbox-id> --scope container -o yaml
FlagDescription
--scope, -sRequired. Log scope: lifecycle, container, or a server-defined scope.
-o raw prints the inline log text, or the content URL if the diagnostic is delivered as a temporary URL.
Retrieve diagnostic events for a sandbox.
osb diagnostics events <sandbox-id> --scope lifecycle -o raw
osb diagnostics events <sandbox-id> --scope runtime -o raw
osb diagnostics events <sandbox-id> --scope runtime -o json
FlagDescription
--scope, -sRequired. Event scope: lifecycle, runtime, or a server-defined scope.
Legacy experimental diagnostics. Prefer osb diagnostics for stable API-backed output.
osb devops inspect <sandbox-id> -o raw
osb devops summary <sandbox-id> -o raw

osb config

Create the default config file at ~/.opensandbox/config.toml with empty values.
osb config init
To use a non-default location, pass --config at the root level:
osb --config /tmp/dev.toml config init
Set a single config value by its dot-path key.
osb config set connection.domain localhost:8080
osb config set connection.protocol http
osb config set connection.api_key <your-api-key>
osb config set defaults.image python:3.12
osb config set defaults.timeout 30m
Print the resolved configuration, including values from the config file and SDK defaults.
osb config show
osb config show -o json

osb skills

List all available bundled skills and their current installation status across all supported targets.
osb skills list
osb skills list -o json
Print the content of a specific bundled skill.
osb skills show sandbox-lifecycle
Install one or more bundled skills for a target agent tool. The install is non-interactive and idempotent — re-running reports already_present or updated instead of prompting.
# Install a single skill for Claude (project scope)
osb skills install sandbox-lifecycle --target claude --scope project

# Install all bundled skills globally for Codex
osb skills install --all-builtins --target codex --scope global

# Install for Cursor with JSON output (useful in scripts)
osb skills install sandbox-lifecycle --target cursor --scope project -o json
FlagDescription
--target, -tRequired. Target agent tool: claude, cursor, codex, copilot, windsurf, cline, opencode, or all.
--scopeRequired. project (current directory) or global (home directory).
--all-builtinsInstall all five bundled skills at once.
--force, -fAccepted for compatibility. Installs are already non-interactive and idempotent.
Remove a previously installed skill from a target.
osb skills uninstall sandbox-troubleshooting --target claude --scope global
FlagDescription
--target, -tRequired. Target agent tool (same choices as install).
--scopeRequired. project or global.

osb credential-vault

The Credential Vault stores secrets inside the sandbox egress sidecar. You must create the sandbox with --credential-proxy and an explicit --network-policy-file before writing vault state.
Use --file - to read a JSON/YAML payload from stdin. Do not pass plaintext credential values as command-line flags — keep them in the payload stream or file.
# Create vault state from a file
osb credential-vault create <sandbox-id> --file vault.yaml -o json

# Read current vault state
osb credential-vault get <sandbox-id> -o json

# Patch vault state
osb credential-vault patch <sandbox-id> --file mutation.yaml -o json

# List individual credentials and bindings
osb credential-vault credential list <sandbox-id> -o json
osb credential-vault binding list <sandbox-id> -o json

# Delete vault state
osb credential-vault delete <sandbox-id> -o json

Build docs developers (and LLMs) love