Skip to content

Exit codes

Uni-CLI pairs a process exit code with a structured error envelope on stderr. Read error.code and error.suggestion for the specific cause and next command.

CodeNameMeaningTypical next step
0successThe operation completedRead data
1generic errorAn unexpected runtime error occurredRead the envelope and logs
2usage errorA command or argument is invalidRun unicli describe or unicli help
66empty resultThe request completed with no matching itemAdjust the query or identifier
69service unavailableA required service, provider, or tool is unavailableFollow error.suggestion
75temporary failureA timeout, rate limit, or network error occurredRetry after the suggested delay
77authentication requiredLogin or permission is requiredRun the supplied auth or permission command
78configuration errorAn adapter or local configuration needs attentionInspect the named source or config file

Shell example

bash
if output=$(unicli hackernews top --limit 5 -f json); then
  printf '%s\n' "$output" | jq '.data'
else
  status=$?
  printf 'Uni-CLI exited with %s\n' "$status" >&2
fi

Agent example

text
Run the command with -f json.
If it exits 0, use data.
If it exits 75, wait and retry.
For other failures, read error.code, error.suggestion, and error.remedy.command.

The canonical constants live in src/core/envelope.ts.

Released under the Apache-2.0 License