orchestratr
referenceCLI reference

orcr api

the api schema and api snapshot verbs: the versioned protocol schema and a consistent runtime-state document that make the socket API self-describing.

orcr api mirrors herdr api. it exposes the socket protocol as data so the API is self-describing for languages without a TypeScript SDK. the schema is the contract; the CLI is one client of it.

orcr api schema   [--json | --output <path>]
orcr api snapshot [--json]

schema

prints the versioned JSON schema of the socket protocol: every method's params and result, event payloads, error codes, and the protocol version. this is the single source of truth that the TypeScript SDK's generated client is produced from, and it is how a client in any language discovers the wire contract.

orcr api schema --output ./orcr-schema.json
orcr api schema --json | jq '.methods | keys'
  • --json prints the schema to stdout.
  • --output <path> writes it to a file.

the schema is documented in prose on the socket API reference.

snapshot

dumps live runtime state (agents, the queue, loops, and GC clocks) in one consistent document stamped with snapshot_seq. the sequence stamp lets a client subscribe to the event stream from exactly that point without missing or double-applying an update (this is the basis for orcr top and the SDK's watch).

orcr api snapshot --json | jq '.agents[] | select(.status == "blocked")'

JSON result: {snapshot_seq, agents:[…], loops:[…], queue:[…]}. the agent rows are the same flat shape as agent ls; each loop carries its active runs.

prefer api snapshot or ls --json for machine-readable state, not top (which is a TUI with no --json). see the socket API reference for how snapshots and subscriptions compose under one cursor pin.

On this page