Global Flags
These flags apply to all commands.oc login, oc whoami, and oc logout
oc login uses browser-assisted device confirmation and saves a private local
CLI credential without printing it. Use --no-browser over SSH, and --force
to replace a saved credential. oc whoami prints the effective user and
workspace. oc logout revokes a CLI-managed key before clearing it locally;
--local skips remote revocation explicitly.
An active --api-key or OPENCOMPUTER_API_KEY override takes precedence and
must be unset before login or remote logout. oc logout --local can still
clear the saved CLI login. CI, servers, and SDK applications should continue
to use explicitly managed org keys.
oc sandbox
Manage sandbox lifecycle.
oc sandbox create
Create a new sandbox. Alias: oc create
oc sandbox list
List all running sandboxes. Alias: oc ls
Output columns: ID, TEMPLATE, STATUS, CPU, MEM, AGE
oc sandbox get <id>
Show detailed information for a sandbox.
Output: ID, Template, Status, CPU, Memory, Started, Ends.
oc sandbox kill <id>
Terminate and remove a sandbox.
oc sandbox hibernate <id>
Snapshot VM state and stop the sandbox. Displays snapshot size on success.
oc sandbox wake <id>
Resume a hibernated sandbox.
oc sandbox set-timeout <id> <seconds>
Update the idle timeout for a running sandbox.
oc exec
Execute commands inside a sandbox.
oc exec <id> [flags] -- <command...>
By default, creates an exec session and prints the session ID with attach instructions. Use --wait to run synchronously — output streams to your terminal and the CLI exits with the process exit code.
oc exec list <id>
List active exec sessions for a sandbox.
Output: session ID, status (running or exited (code)), command, client count.
oc exec attach <id> <session-id>
oc exec kill <id> <session-id>
Kill an exec session.
oc shell
oc shell <id>
Open an interactive terminal (PTY) session via WebSocket.
Terminal size is auto-detected and resize events are forwarded. Press
Ctrl+D or type exit to disconnect. The PTY session is cleaned up automatically on exit.
oc checkpoint
Manage sandbox checkpoints. Alias: oc cp
oc checkpoint create <sandbox-id>
Create a named checkpoint of a running sandbox.
oc checkpoint list <sandbox-id>
List checkpoints for a sandbox.
Output columns: ID, NAME, STATUS, SIZE, CREATED
oc checkpoint restore <sandbox-id> <checkpoint-id>
Revert a sandbox in-place to a checkpoint. All changes since the checkpoint are lost.
oc checkpoint spawn <checkpoint-id>
Create a new sandbox from a checkpoint (fork).
oc checkpoint delete <sandbox-id> <checkpoint-id>
Delete a checkpoint.
oc patch
Manage checkpoint patches — scripts that run when a sandbox is spawned from a checkpoint.
oc patch create <checkpoint-id>
oc patch list <checkpoint-id>
Output columns: ID, SEQ, DESCRIPTION, STRATEGY, CREATED
oc patch delete <checkpoint-id> <patch-id>
oc preview
Manage preview URLs for exposing sandbox ports to the internet.
oc preview create <sandbox-id>
oc preview list <sandbox-id>
Output columns: PORT, HOSTNAME, SSL, CREATED
oc preview delete <sandbox-id> <port>
oc config
Manage CLI configuration. Settings are persisted to a local config file.
For a local interactive setup, prefer oc login.
oc config set <key> <value>
Supported keys: api-key, api-url.
api-key clears CLI-login management metadata; oc logout will not
remotely revoke a manually supplied key.