> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/cli/using-the-cli/exit-codes.md).

# Exit codes

The CLI uses three exit codes:

| Code  | Meaning                                                                          |
| ----- | -------------------------------------------------------------------------------- |
| `0`   | Success.                                                                         |
| `1`   | Any error — HTTP failure, bad input, permission denied, network timeout, etc.    |
| `130` | Interrupted with Ctrl-C — `push` and `promote` only (since celigo-cli 2026.9.1). |

Scripts should not branch on specific non-zero codes beyond these. Read stderr and the JSON response body for diagnostic detail, or re-run with `--verbose` to see the exact HTTP exchange.

## Interrupted `push` and `promote`

`celigo push` and `celigo promote` exit `130` when interrupted with Ctrl-C. The requests already on the wire finish (their write-backs included), what landed is saved, and the rest of the plan is reported `skipped` — the summary reads `N items not attempted (interrupted) — push again to continue`, and a batch-mate still waiting for the wire is skipped, not sent. Re-run the command to continue; a second Ctrl-C aborts at once. See [push](/cli/local-tree/push.md) and [promote](/cli/local-tree/promote.md).

## Gates that use exit `1`

Some commands turn a result into an exit code so a pipeline can gate on it:

| Command                                                      | Exit `1` when                                                                                                                                                                                                                                                                           |
| ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `celigo push --dry-run`                                      | Any planned item is refused — a half-merged file, invalid JSON, a document outside the tree's scope. Changes that are merely withheld exit `0`.                                                                                                                                         |
| `celigo promote --to <name> --dry-run`                       | Any planned item is refused.                                                                                                                                                                                                                                                            |
| `celigo status --exit-code`                                  | The tree is not clean (modified, missing, untracked, or moved files, or an unreadable pull-generated file). Without the flag `status` is informational and exits `0`.                                                                                                                   |
| `celigo diff --exit-code`                                    | Any compared resource differs from the live account (changed, deleted on the server, or local only). Without the flag `diff` is informational and exits `0`.                                                                                                                            |
| `celigo integrations persist-settings`                       | Any field is reported `not-saved`, the body is `unverified` (without `--allow-unverified`), or the connector refuses the save (`success: false`). The platform answers `{"success": true}` even when it saved nothing, so the exit code follows the re-read document, not the response. |
| `celigo flows retry-errors` and the other bulk error actions | The run changed nothing — no key matched an open error.                                                                                                                                                                                                                                 |

## Scripting

### Bash

```bash
if celigo flows get "$FLOW_ID" >/dev/null 2>&1; then
  echo "flow exists"
else
  echo "missing or failed; see error output above"
  exit 1
fi
```

### PowerShell

```powershell
celigo flows get $FlowId | Out-Null
if ($LASTEXITCODE -ne 0) {
  throw "flow fetch failed (exit $LASTEXITCODE)"
}
```

## Debugging non-zero exits

1. **Re-run with `--verbose`.** The underlying HTTP request and response print to stderr with `Authorization` redacted.
2. **Check the API status code and `errors[]` body.** The [Errors & status codes](https://developer.celigo.com/api/using-the-api/errors) page in the API section covers the full error envelope and common codes.
3. **Sanity-check your token** — `celigo profile whoami` (or any authenticated read) with the same token disambiguates auth problems from request problems.
