Skip to main content

oc agent create <id>

Create a new agent. HTTP API →
--core
string
required
Managed core to use (e.g. hermes, openclaw). Required — a core-less agent has no runtime and can’t connect channels or install packages. To create a raw agent with your own snapshot, use the REST API directly.
--secret
string
Secret KEY=VALUE (repeatable). Secrets are stored encrypted and injected at sandbox creation.
--no-wait
boolean
Return immediately after the agent record is created, without polling for sandbox readiness. The async JSON field indicates the caller should re-check with oc agent get.
oc agent create my-hermes --core hermes
oc agent create my-hermes --core hermes --secret OPENAI_API_KEY=sk-...

oc agent list

List all agents. Alias: oc agent ls HTTP API → Output columns: ID, CORE, CHANNELS, PACKAGES, CREATED
oc agent ls
oc agent ls --json

oc agent get <id>

Show detailed information for an agent, including instance status. HTTP API → Output: ID, Name, Core, Channels, Packages, Created, Instance (ID + status).
oc agent get my-hermes

oc agent delete <id>

Delete an agent. Cascades to instances and sessions — the sandbox is destroyed. HTTP API →
--yes
boolean
Skip the confirmation prompt. Required when stdin is not a TTY (e.g. running from a script) — the command otherwise refuses rather than destroying state silently on a typo.
oc agent delete my-hermes           # interactive: prompts "Delete agent my-hermes? [y/N]"
oc agent delete my-hermes --yes     # script-safe: no prompt

oc agent connect <id> <channel>

Connect a messaging channel to an agent. HTTP API →
--bot-token
string
Telegram bot token (Telegram channel only). If omitted and stdin is a TTY, the CLI prompts interactively. If omitted and stdin is not a TTY (scripts, CI, agent callers), the command exits with an error — pass the flag explicitly.
oc agent connect my-hermes telegram                        # interactive prompt
oc agent connect my-hermes telegram --bot-token 123:ABC    # script-safe

oc agent disconnect <id> <channel>

Disconnect a channel from an agent. Removes webhook registration and config. HTTP API →
--yes
boolean
Skip the confirmation prompt. Required when stdin is not a TTY.
oc agent disconnect my-hermes telegram
oc agent disconnect my-hermes telegram --yes

oc agent channels <id>

List channels connected to an agent. HTTP API →
oc agent channels my-hermes

oc agent install <id> <package>

Install a package on an agent. HTTP API →
oc agent install my-hermes gbrain

oc agent uninstall <id> <package>

Uninstall a package from an agent. Data is preserved by default. HTTP API →
--yes
boolean
Skip the confirmation prompt. Required when stdin is not a TTY.
oc agent uninstall my-hermes gbrain
oc agent uninstall my-hermes gbrain --yes

oc agent packages <id>

List packages installed on an agent. HTTP API →
oc agent packages my-hermes

Exit codes

oc agent commands use a class-based exit code scheme so scripts and agent callers can branch on failure type without parsing stderr.
CodeClassMeaning
0SuccessCommand completed successfully
1General errorUnclassified failure, bad args/flags, aborted confirmation
3Upstream 4xxNot found, unauthorized, org mismatch, bad request
4ConflictAlready exists, invalid state transition
5TransientTimeout, retry-safe — try again
Codes 3–5 are emitted by create, install, and get when the failure carries a known error code. Other subcommands exit 0 on success and 1 on any failure.