Envelope format
When stdout is not a TTY (and always with--json), every command emits a structured JSON envelope that unifies success and failure:
"ok": false and additional fields:
Field reference
Error codes and exit codes
erroris always a stable machine code (e.g.confirmation_required,human_review_required,engine_not_available). Freeform messages go inmessage, noterror.- Commands that fail with
"ok": falsereturn a non-zero exit code. - When a command succeeds, the exit code is zero.
Agent stop-gates
Agents must stop whenerror is either confirmation_required or human_review_required, show the message to a human, and only rerun a next_actions[].cmd after explicit approval. Do not add confirmation flags (e.g. --confirm-rights, --yes, --attest) without human input.
Enabling JSON output
Global options
Auth
Primary commands
Noun-first agent surface
The agent contract uses stable resource nouns that match API resources and the/v1/resources catalog. Legacy ergonomic verbs (e.g. upload, read, chat, extract, parse, audit, redact, render) remain compatible, but the preferred agent surface is:
resourcesdocumentsfilesjobsagentsworkflowscollections
okra resources list to discover every API noun and verb, and okra <noun> --help for a resource’s subcommands.
Grounded context commands
Before (or instead of) a full parse, thecontext commands navigate a source and retrieve bounded, cited context: