Share feedback
Answers are generated based on the documentation.

sbx create opencode

DescriptionCreate a sandbox for opencode
Usagesbx create opencode PATH [PATH...] [flags]

Description

Create a sandbox with access to a host workspace for opencode.

The workspace path is required and will be mounted inside the sandbox at the same path as on the host. Additional workspaces can be provided as extra arguments. Append ":ro" to mount them read-only.

Use "sbx run --name SANDBOX" to attach to the agent after creation.

Global options

OptionDefaultDescription
--cloneRun the agent on a private in-container clone of the host Git repository (mounted read-only) instead of bind-mounting the workspace; the agent's commits are accessible via the sandbox-<name> git remote on the host
--cpus0Number of CPUs to allocate to the sandbox (0 = auto: all host CPUs)
-D, --debugEnable debug logging
--deny-networkAdd a per-sandbox network deny rule at creation time. Can be specified multiple times. The rule applies only to the new sandbox and can be listed or removed later with `sbx policy ls <NAME>` / `sbx policy rm network --sandbox <NAME> --resource <HOST>`. Safe under centralized governance because a local deny can only narrow, never widen, egress.
--kitexperimental Kit reference (directory, ZIP, or OCI). Can be specified multiple times
-m, --memoryMemory limit in binary units (e.g., 1024m, 8g). Default: 50% of host memory, max 32 GiB
--nameName for the sandbox (default: <agent>-<workdir>, letters, numbers, hyphens, periods, plus signs and minus signs only)
-p, --publishPublish a sandbox port to the host (can be repeated): [[HOST_IP:]HOST_PORT:]SANDBOX_PORT[/PROTOCOL]
-q, --quietSuppress verbose output
-t, --templateContainer image to use for the sandbox (default: agent-specific image)

Examples

# Create in the current directory
sbx create opencode .

# Create with a specific path
sbx create opencode /path/to/project

# Create with additional read-only workspaces
sbx create opencode . /path/to/docs:ro