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:Configuration
Set your API key (stored in~/.oc/config.json):
Resolution Order
Configuration values are resolved in this order (highest priority first):| Priority | Source | Example |
|---|---|---|
| 1 (highest) | CLI flags | --api-key=xxx |
| 2 | Environment variables | OPENCOMPUTER_API_KEY |
| 3 | Config file | ~/.oc/config.json |
| 4 (lowest) | Defaults | https://app.opencomputer.dev |
Global Flags
Every command supports these flags:| Flag | Environment Variable | Description |
|---|---|---|
--api-key | OPENCOMPUTER_API_KEY | API key for authentication |
--api-url | OPENCOMPUTER_API_URL | Control plane URL |
--json | — | Output as JSON instead of tables |
Quick Example
Modules
| Module | Description |
|---|---|
| Sandbox | Create, list, and manage sandbox lifecycles |
| Commands | Execute shell commands in a sandbox |
| Shell | Interactive PTY terminal sessions |
| Checkpoints | Snapshot, fork, and restore sandboxes |
| Patches | Apply scripted modifications to checkpoints |
| Preview URLs | Expose sandbox ports to the internet |
JSON Output
Every command supports--json for machine-readable output, making it easy to script with jq: