oc CLI lets you manage OpenComputer sandboxes directly from your terminal — create sandboxes, run commands, open interactive shells, manage checkpoints, and more.
Installation
Configuration
Resolution Order
| 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
| 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 |
Key Workflows
Quick Start
JSON Output & Scripting
All commands support--json for machine-readable output:
Top-level Shortcuts
| Shortcut | Expands to |
|---|---|
oc create | oc sandbox create |
oc ls | oc sandbox list |
oc cp | oc checkpoint |
Create and Shell In
Hibernate for Cost Savings
Checkpoint and Fork
Command Reference
| Command | Description |
|---|---|
oc sandbox | Create, list, kill, hibernate, wake |
oc exec | Run commands, manage exec sessions |
oc shell | Interactive PTY terminal |
oc checkpoint | Snapshot, fork, restore |
oc patch | Checkpoint-attached scripts |
oc preview | Expose ports to the internet |
oc config | Configure API key and API URL |