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

# CLI

The Channel3 CLI calls the Channel3 API from a terminal or script.

**1. Install the CLI**

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
npm install -g @channel3/cli
```

To update an existing installation:

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
npm update -g @channel3/cli
```

> [!NOTE]
>
> **Upgrading from 0.4.x?** Versions up to `0.4.1` were installed with Homebrew.
> Remove that build first — it is no longer updated:
>
> ```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
> brew uninstall --cask channel3
> npm install -g @channel3/cli
> ```
>
> The binary name and `CHANNEL3_API_KEY` are unchanged, but some flags are not.
> Most importantly, **`--query` is now `--query-param`** for search terms. See
> [Migrating to 0.5.0](/cli/migrating).

**2. Set an API key**

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
export CHANNEL3_API_KEY="your_api_key_here"
```

Set optional locale defaults:

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
export CHANNEL3_LANGUAGE="en"
export CHANNEL3_COUNTRY="US"
export CHANNEL3_CURRENCY="USD"
```

> [!NOTE]
>
> Add the `export` lines to `~/.zshrc` (or `~/.bashrc`), then `source ~/.zshrc`.

You can also pass `--api-key` to an individual command.

**3. Run a search**

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
channel3 products search --query-param "organic cotton t-shirt"
```

## Explore the CLI

> **[Search](/cli/search)**
>
> Keyword search, filters, pagination, and locale.

> **[Image search](/cli/image-search)**
>
> Search from a public image URL or local image file.

> **[Similar products](/cli/similar-products)**
>
> Find related catalog products from a product ID.

> **[Look up a URL](/cli/lookup)**
>
> Resolve a retailer page to a canonical product.

> **[Brands, websites, and categories](/cli/brands)**
>
> Browse catalog entities and use them in product filters.

> **[Format output](/cli/output)**
>
> Select formats or extract fields with JMESPath.

The [full CLI reference](/cli/usage) keeps every command in one place.


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