> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trychannel3.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Format Output

Output is a table when you're at a terminal and JSON when piped, so
`channel3 ... | jq` works without a flag. Choose explicitly with `--format`:

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
channel3 products search --query-param "lamp" --format table
```

`--format` accepts `json`, `table`, `yaml`, `csv`, `jsonl`, `raw`, and `http`.
`jsonl` emits one compact JSON value per line and flattens arrays; `raw` emits
the server's bytes unmodified; `http` prints the full response with status line
and headers, like `curl -i`.

## Extracting fields

`--query` takes a [JMESPath](https://jmespath.org) expression applied to the
response before formatting.

Extract only product titles:

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
channel3 products search \
  --query-param "running shoes" \
  --query "products[].title"
```

Extract the first offer price:

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
channel3 products search \
  --query-param "merino sweater" \
  --limit 1 \
  --query "products[0].offers[0].price"
```

Compare retailer offers:

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
channel3 products search \
  --query-param "dyson vacuum" \
  --limit 1 \
  --query "products[0].offers[].{domain: domain, price: price.price}"
```

<Warning>
  `--query` is the projection flag, **not** the search term. The search term is
  `--query-param`. In CLI versions up to `0.4.1`, `--query` meant the search
  term, so old scripts must be updated or they will fail.
</Warning>

## Migrating from `--transform`

Versions up to `0.4.1` used `--transform` with
[GJSON](https://github.com/tidwall/gjson/blob/master/SYNTAX.md). That flag is
gone; `--query` replaces it, using JMESPath syntax:

| GJSON (`--transform`) | JMESPath (`--query`) |
| - | - |
| `products.#.title` | `products[].title` |
| `products.0.offers.0.price` | `products[0].offers[0].price` |
| `products.0.offers.#.{domain:domain,price:price}` | `products[0].offers[].{domain: domain, price: price.price}` |

The rule of thumb: `.#.` becomes `[]`, and a numeric index like `.0.` becomes
`[0]`.

`--format-error` and `--transform-error`, which formatted and projected error
output separately, have no equivalent.

## Pagination

`--page-all` follows pagination and streams every result as NDJSON, up to
`--page-limit` pages (default 10):

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
channel3 products search --query-param "socks" --page-all --page-limit 3
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.