> 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). Agents can also search and read this documentation through its [MCP server](https://developer.celigo.com/~gitbook/mcp).

# Exit codes

The CLI uses these exit codes:

| Code  | Meaning                                                                                                                             |
| ----- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `0`   | Success.                                                                                                                            |
| `1`   | Any error — HTTP failure, bad input, permission denied, network timeout, etc. — and the [gates](#gates-that-use-exit-1) below.      |
| `75`  | A [bounded wait](#bounded-waits) ended with its job still in progress (since celigo-cli 2026.11.2).                                 |
| `129` | Interrupted by SIGHUP (a closed terminal, a dropped SSH session) during a storage transfer (since celigo-cli 2026.10.1).            |
| `130` | Interrupted with Ctrl-C — `push` and `promote` (since celigo-cli 2026.9.1), and the storage transfers (since celigo-cli 2026.10.1). |
| `143` | Ended by SIGTERM during a storage transfer (since celigo-cli 2026.10.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 each request the command sent. `celigo skills` passes on the exit status of the skills CLI it runs.

Since celigo-cli 2026.11.2, a command that fails in JSON format, with stdout not a terminal, also prints its error on stdout as one JSON document. The stdout of a failed command is therefore not empty: test the exit status, never whether a command printed anything. See [When a command fails](https://developer.celigo.com/cli/using-the-cli/output-formats.md#when-a-command-fails).

Since celigo-cli 2026.10.2, a failed command exits `1` on Windows as well, a `--jq` that fails on the answer included. With Node 24 on Windows, earlier releases printed an API error's message, then `Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c`, and ended with a crash exit code instead of `1`. See [Troubleshooting](https://developer.celigo.com/cli/using-the-cli/troubleshooting.md#assertion-failed-on-windows).

## Bounded waits

Since celigo-cli 2026.11.2, three commands wait for a run and report how it ended as the exit code: `celigo jobs wait <id>`, `celigo flows run <id> --wait`, and `celigo flows replay <id> --wait`.

| Code | The wait ended because                                                                                                       |
| ---- | ---------------------------------------------------------------------------------------------------------------------------- |
| `0`  | Every job completed. Record errors do not fail a job: stderr gives their count, and `celigo jobs errors <jobId>` lists them. |
| `1`  | A job failed or was canceled, or a read of a job failed, such as a `404` for an id that no job has.                          |
| `75` | A job is still queued, running, retrying, or canceling at the deadline: `--timeout` seconds, 100 by default.                 |

The command prints each job as the wait left it, so a wait that exits `1` for a failed or canceled job, or `75`, prints the job, not an error document. On `75`, stderr names the command that keeps waiting:

```
Job 6a1b2c3d4e5f6a7b8c9d0e1f is still running after 100s — run 'celigo jobs wait 6a1b2c3d4e5f6a7b8c9d0e1f' again to keep waiting (exit 75; nothing was resent).
```

Run that command to resume. Do not run `flows run` or `flows replay` a second time, which starts another run. When one job failed and another is still in progress, the exit code is `1`. For a script that branches on these codes, see [Wait for a run](https://developer.celigo.com/cli/using-the-cli/scripting.md#wait-for-a-run); the commands are [`jobs wait`](https://developer.celigo.com/cli/commands/jobs.md#celigo-jobs-wait), [`flows run`](https://developer.celigo.com/cli/commands/flows.md#celigo-flows-run), and [`flows replay`](https://developer.celigo.com/cli/commands/flows.md#celigo-flows-replay).

## 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](https://developer.celigo.com/cli/local-tree/push.md) and [promote](https://developer.celigo.com/cli/local-tree/promote.md).

## Interrupted storage transfers

Since celigo-cli 2026.10.1 a storage transfer cleans up before it exits on SIGINT (Ctrl-C, `130`), SIGTERM (`143`), or SIGHUP (`129`):

* **`storage upload`** names the pending item on stderr as soon as a multipart upload starts (`upload 5f83a9b2c7d3e8f1a2b3c4d5 started - if it is interrupted, cancel it with: celigo storage cancel-upload 5f83a9b2c7d3e8f1a2b3c4d5`). On a signal it cancels that item — one request, a short wait — and then exits. When the cancel cannot be confirmed in time, it prints the `celigo storage cancel-upload <id>` command that discards the item. A second signal exits at once.
* **`storage download`**, **`storage query -o`**, and **`storage query-results -o`** write to a temporary file beside the target and rename it into place when the transfer finishes. On a signal they remove the temporary file, so no half-written file is left behind.

See [storage](https://developer.celigo.com/cli/commands/storage.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, an error from `celigo lint`'s logic rules unless `--allow-lint-errors` (since celigo-cli 2026.10.1), and a router whose `script` is `null` or an MCP server update while the server has an upstream change awaiting approval (since celigo-cli 2026.10.2). Changes that are merely withheld exit `0`. |
| `celigo promote --to <name> --dry-run`                       | Any planned item is refused. Since celigo-cli 2026.10.2 that includes a router whose `script` is `null` and an MCP server update while the target's copy has an upstream change awaiting approval.                                                                                                                                                                                                         |
| `celigo status --exit-code`                                  | The tree is not clean (modified, missing, untracked, or moved files, an unreadable pull-generated file, or — since celigo-cli 2026.10.1 — a parked or unfinished resource). 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), or — since celigo-cli 2026.10.1 — one is unfinished. Without the flag `diff` is informational and exits `0`.                                                                                                                                                                                          |
| `celigo lint`                                                | It reports an error-level finding. With `--strict`, every warning counts as one. Since celigo-cli 2026.10.2, a router whose `script` is `null` is an error whatever the account already holds, so a pristine pull of a flow that holds one fails.                                                                                                                                                          |
| `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. Since celigo-cli 2026.10.1, `retry-errors` without keys also fails when the step has open errors but none carries a `retryDataKey` (connection-level errors, which a rerun of the flow clears). With no open errors at all it exits `0`.                                                                                                           |

Since celigo-cli 2026.10.1, these commands also exit `1` when what they asked for did not happen — often where the platform still answered with a success status:

| Command                                                 | Exit `1` when                                                                                                                                                                                                                                                                                                                                                            |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `set`, `update`, `exports reset-cursor --snapshot-mode` | The server's reply still holds a field the write changed at its previous value. `set` (after a GET + PUT) and `reset-cursor` print `not stored` on stderr; on an Integration App's document, all three name the fields the app kept (`the platform kept its own value for …`). See [Troubleshooting](https://developer.celigo.com/cli/using-the-cli/troubleshooting.md). |
| `celigo connections ping`                               | The ping failed (`Ping failed: …` on stderr). The API answers a failed ping with `200` and an `errors` array.                                                                                                                                                                                                                                                            |
| `celigo flows run`                                      | The platform refused every export of the flow, such as a disabled flow's (`Flow … was not run — the platform refused every export: …`). A refused export in a run whose other exports started is a warning.                                                                                                                                                              |
| `celigo topics publish`                                 | The platform rejected any message (`… rejected (see responses above); … published.`).                                                                                                                                                                                                                                                                                    |
| `celigo notifications subscribe` / `unsubscribe`        | The API refused any item (`… notification items failed (statusCode 4xx above); the rest were applied.`).                                                                                                                                                                                                                                                                 |
| `celigo storage move`                                   | Any item could not be moved (`… could not be moved (see results above); … moved.`).                                                                                                                                                                                                                                                                                      |
| `celigo end-users invite`                               | Any invitation failed (`… invites failed (status "failed" above); the rest were processed.`).                                                                                                                                                                                                                                                                            |
| `celigo alerts add-recipients` / `remove-recipients`    | Any targeted alert could not be updated.                                                                                                                                                                                                                                                                                                                                 |
| `celigo jobs diagnostics`                               | The job has no diagnostics archive — a very recent job, or one past its purge date.                                                                                                                                                                                                                                                                                      |
| `celigo tools execution-logs`                           | The platform has no execution log for the run — not the tool's, not visible to this token, or not written yet.                                                                                                                                                                                                                                                           |
| `celigo account snapshot`                               | A listing failed (the network, a `5xx`, a `429` past its retries, a malformed answer). The index is saved with the gap recorded and is never reused as fresh. A listing the token may not read (`401` or `403`) is recorded with a note and exits `0`.                                                                                                                   |

Since celigo-cli 2026.10.2, two more commands exit `1` where the platform answers `200`:

| Command                         | Exit `1` when                                                                                                                                                                                                                                            |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `celigo workspace-users invite` | Any address was not invited, an address that already has access included (`… addresses were not invited (see "result" above); the rest were. …`). Each address's `result` carries the platform's reason when it gives one.                               |
| `celigo ai-agents chat`         | The agent could not finish the turn: the error arrives inside the `200` answer's event stream, and the command names it on stderr. Also when the answer is not an event stream, so whether the turn succeeded is unknown. Added in celigo-cli 2026.10.2. |

Since the same release, these writes are refused before they write anything, exit `1`, where they used to exit `0`: a router whose `script` is `null` in any `create`, `update`, or `set`; a bare rules array for an export's or import's filter in `set`; a new value for a field the `PUT` cannot carry — a sync's `_integrationId`, a workspace user's `userType` — in `syncs update` or `workspace-users update`; and `mcp-servers set` while an upstream change awaits approval. See [Scripting patterns](https://developer.celigo.com/pages/AFPy1lX0hPDwroOPj3tE#what-changed-for-scripts-in-celigo-cli-2026.10.2).

Since celigo-cli 2026.11.2, these commands exit `1` where they exited `0`:

| Command                                                                                                                             | Exit `1` when                                                                                                                                                                      |
| ----------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `celigo flows run`                                                                                                                  | The platform answers the run with an error and no job (`Flow … was not run — the platform answered with an error and no job: …`). The command printed that answer as a queued run. |
| `celigo integrations delete-api-group`                                                                                              | The platform keeps the group, which it does while APIs are in it (`The platform kept API group … in integration …`). The command reported the group deleted.                       |
| `list --integration <id>` on `flows`, `exports`, `imports`, `async-helpers`, and `syncs`                                            | No integration has the id. The platform answers `200` with an empty list there, which the command printed as `[]`.                                                                 |
| `update` on `iclients`, `http-connectors`, `http-connector-resources`, `http-connector-endpoints`, and `trading-partner-connectors` | No document has the id. The platform's `PUT` creates one there, so the command created a document and printed it as the update. It now reads the document first and sends nothing. |

Since the same release, `push --dry-run` and `promote --dry-run` also exit `1` for a tree file that holds a failed command's error output, and `push --dry-run` for an edited companion file that is not UTF-8 text and for a `--prune` delete that a place the tree cannot read could explain. `celigo lint` reports such a companion file as an error, and its seventh logic rule, `connection-binding`, can report one. More option values are refused before any request, and more writes before they are sent. See [Scripting patterns](https://developer.celigo.com/pages/AFPy1lX0hPDwroOPj3tE#what-changed-for-scripts-in-celigo-cli-2026.11.2).

## 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 method and URL of each request, and every retry with its cause, print to stderr. The token, headers, and bodies never do. Before you re-run a create, clone, install, run, or invoke that failed on a timeout, a `429`, or a `5xx`, check whether it landed: it is sent once, and the platform may have carried it out. See [After a timeout, check before you retry](https://developer.celigo.com/cli/using-the-cli/scripting.md#after-a-timeout-check-before-you-retry).
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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.celigo.com/cli/using-the-cli/exit-codes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
