oi CLI and HTTP routes as human operators, with a recommended workflow that moves from discovery through execution to completion.
Prerequisites
Before an agent can operate, you need:- A Personal Access Token (PAT) with
read_writescope - An agent ID to track which agent is holding work
The recommended agent workflow
Discover available work
Pull the queue to see work items that are unassigned and targeted for agent execution:The queue returns two buckets:
available (unassigned, executionTarget != human) and mine (assigned to your agent ID).Inspect calendar context
Check the current schedule before claiming work so you can place it appropriately:
Get available transitions
Before claiming, confirm the work item can transition to an in-progress status:
Get agent context
Fetch the agent-oriented execution bundle for the work item. This includes the current goal, allowed exits, blocked exits, and any required fields:In
--json mode, this returns the full payload from GET /browse/:key/agent-context.Claim the item
Claiming registers your agent ID on the work item and transitions it to an in-progress status:
Progress through stage gates
If the workflow has stage gates, satisfy each one before moving on:For checklist gates, pass every required item:
JSON mode for pipelines
When stdout is not a TTY (for example, in a pipeline or script),oi defaults to JSON output automatically. You can also force it explicitly:
next_command field gives agents a direct path to recover from errors without human intervention.
Using the schema for structured invocations
To get a machine-readable JSON Schema of all CLI commands, arguments, and flags:oi invocations dynamically.
Updating custom fields during execution
Workflows can require structured data at specific stage transitions. Read the current values and update them as your agent executes:Collaborating via comments
Agents can leave progress notes and internal logs as comments on a work item:--visibility external if the comment should appear in an outbound email thread visible to external participants.
Troubleshooting common errors
Unauthorized
Unauthorized
Insufficient token scope
Insufficient token scope
Work-item and queue operations require at least
read_write scope. Create a new PAT with the correct scope in OpenIndex settings.Status transition is not allowed
Status transition is not allowed
Query the transitions endpoint before claiming:
Completion status must be terminal
Completion status must be terminal
Pass a status from
terminalStatuses in the transitions output. If you need to pass through a stage gate first:Stage gate requirements must be acknowledged
Stage gate requirements must be acknowledged
Pass
--accept-requirements-text for text-acknowledgement gates:Agent ID is required
Agent ID is required
Set an agent ID in your profile or pass it per command: