Exit codes and errors
This page lists the CLI’s exit codes, the error object’s fields, and the common error codes, so a script or an agent can judge success and decide the next step. It applies to every command in the current release.
Exit codes
| Exit code | Meaning | Example |
|---|---|---|
0 | Success | The command finished and printed its result |
1 | Runtime failure | Not signed in, rejected credential, operation error, network failure |
2 | Usage error | Unknown command or option, missing option value, wrong number of arguments |
praxis devops test run uses the exit code for the verdict: 0 when every case passes, non-zero when some fail. A script that must tell “the command failed” from “the tests failed” checks for the error object: usage and runtime failures carry a code, a verdict only shows in the exit code.
The error object
On failure the CLI prints one object, JSON under --json:
| Field | Notes |
|---|---|
code | Error code such as a usage error, not signed in, 401, an operation error, a runtime error |
message | What happened |
hint | What to do next; a generic hint when nothing specific applies |
env | The environment that failed: develop or production |
status | HTTP status from the operation; absent on usage errors |
request_id | Server request identifier; quote it when contacting support |
Common errors
| Code | Cause | What to do |
|---|---|---|
| a usage error | A command word, option, or argument is wrong | Add --help; praxis api <domain> --help lists the domain’s commands |
| not signed in | The environment has no login | praxis login, or set an API key for that environment |
| 401 | The credential was rejected or expired | Sign in again, or use a new API key; a machine token needs refreshing |
| an operation error | The operation refused or the server failed | Read message and status; use request_id to investigate |
| a runtime error | The command hit an unexpected failure | Add --debug to see the request |
When to retry
- 429 and
5xx: retry with exponential backoff, at least one second apart. - 401, 403, a usage error: retrying does not help; fix the credential or the arguments first.
- 404: check that the ID exists; a list command shows the legal values.
Diagnose
--debug prints the request’s method, URL, and headers, never the body or query values. It is the fastest way to spot a wrong environment or a wrong operation:
praxis api model list --debugCredentials never appear in any output.
Next steps
- Command reference: usage and options for every command.
- For agents: machine-readable output and non-interactive runs, which scripts and agents need to judge success.
- Call the platform API: how to find
praxis apicommands, pass parameters and page results.