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

# Output formats

The CLI emits results in one of two formats: JSON (machine-readable) or table (human-readable). Default is JSON.

## Forcing a format

```bash
celigo flows list --format json
celigo flows list --format table
```

Or persist the choice on a profile:

```bash
celigo config set default_format table
```

Or per session:

```bash
export CELIGO_FORMAT=table
```

Priority: `--format` CLI flag > `CELIGO_FORMAT` env var > profile `default_format` > default (`json`).

Since celigo-cli 2026.11.2, `--format` and `CELIGO_FORMAT` are read without regard to letter case, as `config set default_format` is: `CELIGO_FORMAT=TABLE` prints a table. Earlier releases read any spelling other than `json` and `table` as `json`. `config show`, `profile list`, and `profile show` print JSON only for `--format json`, in lower case, on the command line, or with `--jq`. `CELIGO_FORMAT`, the profile's `default_format`, and another spelling such as `--format JSON` leave their text output.

## Table format

Each resource type defines its own column set — commonly `_id`, `name`, and one or two business-relevant fields. Those columns are also what a `list` command requests from the API by default, so `--format table` and the default JSON listing carry the same fields. A `list` with `--fields a,b` draws `_id`, `name`, and the fields you named instead (since celigo-cli 2026.10.1; see [Global flags](https://developer.celigo.com/cli/getting-started/global-flags.md#field-projection-on-list-commands)).

```
$ celigo flows list --fields disabled,lastModified --format table
 _id                      │ name                      │ disabled │ lastModified
──────────────────────────┼───────────────────────────┼──────────┼──────────────────────────
 5f83a9b2c7d3e8f1a2b3c4d5 │ Shopify → NetSuite orders │ false    │ 2026-04-21T12:15:03.120Z
 6a1b2c3d4e5f6a7b8c9d0e1f │ NetSuite → Salesforce     │ false    │ 2026-04-20T09:02:47.513Z
```

Since celigo-cli 2026.10.1, these rules decide how a table prints:

* **Ids are never cut.** A 24-character hex value prints whole, and so does every value in a column named `_id` or ending in `Id` (`_flowId`, `executionId`). Other text columns are capped at a share of the terminal width and cut with `...`; when the ids need more room, the widest of those columns are cut further. When the ids alone are wider than the terminal, the line runs long.
* **Dot-notation columns are filled.** A column such as `byUser.email` shows the nested value.
* **Widths follow the terminal.** CJK and emoji characters take two columns and combining marks none, so columns stay aligned, and a long value is shortened between characters, never through one.
* **Each row stays on one line.** A newline or a tab inside a cell prints as a space.

An empty result prints `No results.`; since celigo-cli 2026.10.1 that includes a list endpoint that answers `204 No Content`.

`tools logs`, `apis logs`, `flows`/`apis`/`tools debug-requests`, and `apis`/`tools request-history` print one row per entry under `--format table` (since celigo-cli 2026.10.1); see [tools](https://developer.celigo.com/cli/commands/tools.md), [apis](https://developer.celigo.com/cli/commands/apis.md), and [flows](https://developer.celigo.com/cli/commands/flows.md).

A list whose command defines no columns shows `_id`, `name`, `_integrationId`, `disabled`, and `lastModified` where the rows have them, or else the first five fields of the first row. A single document prints as the detail view: one line per field, with nested values as indented JSON. A value that has no rows — a count, a string, a list of names — prints as JSON.

## JSON format

For a single resource, `get` returns an object. `list` returns an array. A list endpoint that answers `204 No Content` prints `[]` (since celigo-cli 2026.10.1; earlier releases printed `null`).

`get` returns the complete resource body. `list` returns a projected row by default: `_id`, `name`, and the fields behind the table columns. Pass `--fields all` for complete documents, or a comma-separated list for specific fields. See [Global flags](https://developer.celigo.com/cli/getting-started/global-flags.md) for the full projection rules.

```bash
# Projected rows: identity plus the table columns
celigo flows list

# Complete flow documents
celigo flows list --fields all

# Shape the rows with jq (a --jq listing requests complete documents)
celigo flows list --jq '.[] | {_id, name, disabled}'
```

### Indentation

JSON is indented by two spaces when stdout is a terminal, and printed compact when it is piped or redirected. The compact form avoids sending whitespace through a pipeline. Both forms parse identically:

```bash
celigo flows list                    # indented, readable
celigo flows list | jq '.[0].name'   # compact
celigo flows list > flows.json       # compact
```

## `--jq`

`--jq <expr>` runs the response through jq without piping:

```bash
celigo flows get 5f83a9b2c7d3e8f1a2b3c4d5 --jq '.pageGenerators[]._exportId'
```

A result that is one string prints raw, without quotes; several strings or numbers print as one JSON array; several objects (`.[] | {_id, name}`) print as jq prints them, one indented object after another. Under `--format table` the expression runs first: an array of objects prints as a table, and a result that is not rows — a count, a list of names — prints as JSON (since celigo-cli 2026.10.1). [Global flags](https://developer.celigo.com/cli/getting-started/global-flags.md) covers which jq binary runs and what happens when `--jq` fails after a write.

Since celigo-cli 2026.11.1 the CLI's own jq is 1.8.2, where earlier releases ran 1.7.1, and jq 1.8 answers a few expressions differently: `index` counts code points, `tonumber` refuses surrounding whitespace, `pow10` is gone. See [Results that changed in jq 1.8](https://developer.celigo.com/pages/tbUj42Bh9CQFNJPBLg0P#results-that-changed-in-jq-1.8).

On a `list` command, `--jq` also requests complete documents, so the expression can address any field. That holds only while `--fields` is absent — an explicit `--fields` projects the rows first, and fields outside the projection then resolve to `null`.

## When a command fails

A command that fails says why on stderr and exits with a non-zero status. Since celigo-cli 2026.11.2, in JSON format and with stdout not a terminal — a pipe, a file, a script's or an agent's capture — it also prints the error on stdout, as one JSON document on one line:

```json
{"error":"(422): Validation error: …","command":"celigo imports set"}
```

`error` is the error as stderr words it, with the `Hint:` line the CLI adds to an API error. `command` is the command that failed, or `celigo` alone when none can be named, as for an unknown command. A caller that reads only stdout — one that discards stderr with `2>/dev/null`, or never captures it — then sees why the command failed. Earlier releases printed nothing on stdout.

These rules decide whether the document prints:

* **JSON format only.** `--format table` is for a person, who reads stderr.
* **Never at a terminal.** The error is already on screen.
* **Only when the command printed nothing on stdout.** A command that reports failures in its own output — `push`, `integrations persist-settings`, `lint` with an error finding — has printed that report, so stdout never holds two documents.
* **For every failure that ends a command.** That covers an API error, a refusal (the permission mode, the pin policy, a guard), a failed `--jq` expression, a usage error (an unknown option or command, a missing argument, a group named without a command), and a confirmation with no terminal to ask at.
* **Unfiltered under `--jq`.** The expression was written for the command's output, and there is none.
* **Never where stdout is content of another kind.** A file's bytes or a diagram's text stay as they are: `storage download <id> -`, `jobs download-files --file-id <id>` without `-o`, `edi-transactions download-file` without `--jq`, and `graph --as mermaid` or `--as dot` on flows, APIs, and tools.

The exit status says that a command failed, so check it before you use a command's output. The CLI refuses its own error document where it reads a body or a tree file; see [Check the exit status before you use the output](https://developer.celigo.com/cli/using-the-cli/scripting.md#check-the-exit-status-before-you-use-the-output).

## Text from the server

Names, descriptions, and error messages come from the server, and a terminal acts on a control sequence instead of printing it: a clipboard write (OSC 52), a link whose target differs from its text (OSC 8), a cursor move or an erase, a carriage return that overwrites the line. Since celigo-cli 2026.10.1, what the CLI prints for a person has those removed first — table and detail output, API error messages, and the warnings and notes on stderr that quote a name or a remote system's answer. Removed are every C0 and C1 control character except tab and newline, DEL, and each escape sequence as a whole, so an OSC 8 link keeps its visible text and loses its target. Every other character prints as it is, in any script, emoji included.

JSON output and `--jq` results keep the server's bytes unchanged, so a script that parses them sees exactly what the API returned. The one exception, since celigo-cli 2026.11.1, is the credentials in a run's result, described next.

## Credentials in a run's result

The result of a run or a captured request can echo the credentials the request carried. A virtual import's records, for example, can carry the connection's own `Authorization: Bearer …` header. Since celigo-cli 2026.11.1, the commands that print such a result show those credentials as `********`, as the platform's own previews and stored logs do. The mask applies in JSON, table, and `--jq` output alike, to two things:

* The value of every header that carries a credential, in a header map or in a list of `{name, value}` pairs.
* The userinfo of a captured request's URL, and the value of each credential query parameter in it.

The name decides whether a header or a query parameter holds a credential: `authorization`, a cookie, an API key, any name with `token`, `secret`, `passw`, `signature`, `session`, or `credential` in it, and a name whose last word is `key` or `sig`. Since celigo-cli 2026.11.2 the CORS response headers, such as `Access-Control-Allow-Credentials`, are not masked: they hold a policy, not a credential.

Since celigo-cli 2026.11.2 the mask also applies to:

* The credential parameters of a request's parsed query string, `queryParams`.
* A captured request under any key, not only `request`: an object with a `url` or `uri` beside its headers or an HTTP method. The request stage of an `exports invoke` or `imports invoke` preview, and a test run's step results, printed a credential query parameter of such a request unmasked.
* A run's `relativeURI` in `apis request-history` and `tools request-history`.
* A URL whose userinfo password holds an unencoded `@`. The password is masked whole; earlier releases printed the part after the first `@`.

These commands mask a result's credentials:

* `exports invoke` and `imports invoke`, in every form.
* `ai-agents invoke` and `guardrails invoke`, previews included.
* `tools invoke`.
* `test-run`, `test-run-step-results`, `test-run-step-logs`, and `debug-request-detail` on flows, APIs, and tools.
* `flows error --request-detail` and `flows execution-log-detail`.
* `apis execution-logs` and `tools execution-logs`.
* `apis log-detail`, `tools log-detail`, and `mcp-servers log-detail`.
* `connections debug-logs`, `apis request-history`, and `tools request-history`, since celigo-cli 2026.11.2.

Earlier releases printed these results as the platform returned them. A resource document is never masked by the CLI, because `get` output is edited and sent back; the platform masks its encrypted fields as `******` itself. `flows error --retry-data` prints the retry data as stored, for the same reason.

## Pagination and format

`list` commands auto-paginate via `Link` headers (up to 50 pages by default). The full result set is returned as one flat array.

For body-paginated endpoints (like `flows errors`), the CLI follows `nextPageURL` in the response body and concatenates pages.

To inspect pagination manually, use `--verbose` (see [Global flags](https://developer.celigo.com/cli/getting-started/global-flags.md)).

## Color

ANSI color is enabled when stdout is a TTY. Disable with `NO_COLOR=1` (standard) or by piping output.


---

# 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/output-formats.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.
