OriginRouter CLIExit status

Exit status and error recovery

Most CLI commands use 0 for success and 1 for a general failure. Collaboration commands provide a more specific stable exit-status set. Error prose is for people; automation should prioritize exit status and JSON fields.

General behavior

StatusMeaning
0The command completed as requested. Still inspect JSON business state when required
1General error, network error, invalid state, or a failure outside collaboration-specific classes
Child statusoriginrouter run -- <command> propagates the child process exit status
143The Agent Workspace terminal UI received SIGTERM

An HTTP status is not a process exit status. Authentication and service failures are normally rendered as a readable headline, technical detail, and Next: action, then exit with 1.

Collaboration exit status

StatusMeaningRecommended action
2Invalid arguments, usage, draft, or inputCorrect the command and inspect originrouter --help
3Local daemon or Local API unavailableCheck service status, then service restart if needed
4Login, device trust, E2EE, identity, or workspace permission failureCheck login status, trusted devices, and the permission profile
5Runtime, provider, model, route, or capability unavailableRun doctor on the target device and repair its route
6The run entered failedRun collaboration doctor <run-id>, fix the cause, then retry
7Budget exhausted, budget exceeded, or policy blockedReview run, device, agent budget, or organization policy
8Configuration or plan requires confirmation in a non-interactive flowReview the run and execute confirm; use --yes only when deliberately accepting both startup gates
10Device offline, relay timeout, connection interruption, or incomplete Local API responseInspect actual run state before deciding whether to create again

Status 10 can mean that the request result is uncertain. A daemon-owned run may still be active, so query the same run ID with show or doctor.

JSON automation

if output=$(originrouter collaboration show "$run_id" --json); then
  state=$(printf '%s' "$output" | jq -r '.state')
else
  status=$?
  printf 'originrouter failed with status %s\n' "$status" >&2
  exit "$status"
fi

For create commands, persist the first returned run ID. After a network interruption, query that ID; create another run only after confirming that the original request was not accepted.

Recovery order

  1. Read the complete error, including Impact, Action, and Diagnostic code.
  2. When supported, repeat a read-only command with --json.
  3. Check login status, service status, and doctor.
  4. For an existing collaboration, run collaboration doctor <run-id>.
  5. Repeat a create or write operation only after confirming that the original request was not accepted.

Common authentication failures already map to concrete recovery actions such as signing in again, updating an old CLI, revoking an unused device, or waiting for the key-rotation limit to reset.

Was this page helpful?