Skip to main content
The oc CLI lets you manage OpenComputer sandboxes directly from your terminal — create sandboxes, run commands, open interactive shells, manage checkpoints, and more.

Installation

Download the latest binary for your platform from GitHub Releases:
curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-darwin-arm64 -o /usr/local/bin/oc
chmod +x /usr/local/bin/oc
Verify the installation:
oc --version

Configuration

Set your API key (stored in ~/.oc/config.json):
oc config set api-key YOUR_API_KEY
Optionally set a custom API URL:
oc config set api-url https://app.opencomputer.dev
View current configuration:
oc config show

Resolution Order

Configuration values are resolved in this order (highest priority first):
PrioritySourceExample
1 (highest)CLI flags--api-key=xxx
2Environment variablesOPENCOMPUTER_API_KEY
3Config file~/.oc/config.json
4 (lowest)Defaultshttps://app.opencomputer.dev

Global Flags

Every command supports these flags:
FlagEnvironment VariableDescription
--api-keyOPENCOMPUTER_API_KEYAPI key for authentication
--api-urlOPENCOMPUTER_API_URLControl plane URL
--jsonOutput as JSON instead of tables

Quick Example

# Create a sandbox
oc create

# Run a command
oc exec sb-abc123 -- echo "Hello from the cloud"

# Open an interactive shell
oc shell sb-abc123

# Clean up
oc sandbox kill sb-abc123

Modules

ModuleDescription
SandboxCreate, list, and manage sandbox lifecycles
CommandsExecute shell commands in a sandbox
ShellInteractive PTY terminal sessions
CheckpointsSnapshot, fork, and restore sandboxes
PatchesApply scripted modifications to checkpoints
Preview URLsExpose sandbox ports to the internet

JSON Output

Every command supports --json for machine-readable output, making it easy to script with jq:
# Get a sandbox ID programmatically
ID=$(oc create --json | jq -r '.sandboxID')

# List all running sandbox IDs
oc ls --json | jq -r '.[].sandboxID'