---
title: "Exit codes"
url: "https://docs.phux.sh/reference/exit-codes"
source: "https://github.com/no-phux/phux/blob/06139f37fe877c59ea6c10a70f8a79b4b21dc352/docs/reference/exit-codes.md"
projectVersion: "0.119.0"
protocolVersion: "1.0.0"
stability: "stable"
---

# Exit codes

Exit statuses, for scripts. phux help exit-codes prints the same table.

<!--
GENERATED FILE - do not edit. A unit test byte-compares this page
against `phux gen-reference-docs` output and fails on any drift, so
hand edits do not survive. Regenerate with `just docs-gen`.
-->

Every exit code the `phux` binary uses, from the canonical in-code table that also renders `phux help exit-codes`. The codes are chosen so a script can branch: `3` is distinct from `1` because retry is right for `3` and wrong for `1`; `run`'s timeout is `125` rather than `124` because `run` mirrors the exit code of the command it ran, and the child itself may legitimately exit `124`.

| Code | Meaning |
|---|---|
| `0` | Success. |
| `1` | Failure: no server, no such target, or the verb itself failed. |
| `2` | Usage error, or the server refused the request. |
| `3` | Unanswerable: the selector was resolved against a partial view of the fleet (a federation satellite was unreachable). Retry once the link is back — unlike 1, the target may exist. |
| `124` | `phux wait` gave up because `--timeout` expired. |
| `125` | `phux run` gave up because `--timeout` expired; otherwise `run` mirrors the exit code of the command it ran, so `phux run … && next` composes like a shell. |

`phux run` exits with the child command's own code on success, so `phux run … && next` composes like a shell. A `--help` or `--version` request exits `0`, including when the reader hangs up early (`phux --help | head`).