Skip to main content
The sandbox command group manages the full lifecycle of OpenComputer sandboxes. The most common operations — create and ls — are also available as top-level shortcuts.

Create a Sandbox

oc create
Or with options:
oc create --timeout 600 --cpu 2 --memory 2048 --env NODE_ENV=production

oc create

Alias for oc sandbox create. Creates a new sandbox and prints its ID.
FlagTypeDefaultDescription
--templatestringdefaultTemplate to use
--timeoutint300Sandbox TTL in seconds
--cpuint1Number of vCPUs
--memoryint1024Memory in MB
--envstringEnvironment variable (KEY=VALUE, repeatable)
--metadatastringMetadata (KEY=VALUE, repeatable)

List Sandboxes

oc ls
Output:
ID           TEMPLATE  STATUS   CPU  MEM     AGE
sb-e148d1b0            running  1    1024MB  2m30s
sb-a3f91c27            running  2    2048MB  15m0s

oc ls

Alias for oc sandbox list. Lists all sandboxes for your organization.

Get Sandbox Details

oc sandbox get sb-abc123

oc sandbox get <id>

Displays detailed information about a sandbox including status, resources, and timestamps.

Kill a Sandbox

oc sandbox kill sb-abc123

oc sandbox kill <id>

Immediately terminates a sandbox. All data is lost unless a checkpoint was created.

Hibernate

oc sandbox hibernate sb-abc123

oc sandbox hibernate <id>

Saves the sandbox’s full state (memory + disk) to S3 and stops the VM. The sandbox can be resumed later with wake.

Wake

oc sandbox wake sb-abc123
Or with a new timeout:
oc sandbox wake sb-abc123 --timeout 600

oc sandbox wake <id>

Resumes a hibernated sandbox. All processes and state are restored exactly as they were.
FlagTypeDefaultDescription
--timeoutint300New TTL in seconds after waking

Set Timeout

oc sandbox set-timeout sb-abc123 600

oc sandbox set-timeout <id> <seconds>

Updates the sandbox’s idle timeout and resets the TTL countdown.

Examples

Create and Immediately Shell In

ID=$(oc create --json | jq -r '.sandboxID')
oc shell $ID

Hibernate and Resume Later

# Save state and stop
oc sandbox hibernate sb-abc123

# ... hours later ...

# Resume exactly where you left off
oc sandbox wake sb-abc123
oc shell sb-abc123

List Running Sandboxes as JSON

oc ls --json | jq '.[] | select(.status == "running") | .sandboxID'