> 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.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
