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

<Steps>
  <Step title="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).
    </Note>
  </Step>

  <Step title="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`.
    </Note>

    You can also pass `--api-key` to an individual command.
  </Step>

  <Step title="Run a search">
    ```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
    channel3 products search --query-param "organic cotton t-shirt"
    ```
  </Step>
</Steps>

## Explore the CLI

<Cards>
  <Card title="Search" icon="search" href="/cli/search">
    Keyword search, filters, pagination, and locale.
  </Card>

  <Card title="Image search" icon="image" href="/cli/image-search">
    Search from a public image URL or local image file.
  </Card>

  <Card title="Similar products" icon="git-compare" href="/cli/similar-products">
    Find related catalog products from a product ID.
  </Card>

  <Card title="Look up a URL" icon="link" href="/cli/lookup">
    Resolve a retailer page to a canonical product.
  </Card>

  <Card title="Brands, websites, and categories" icon="tags" href="/cli/brands">
    Browse catalog entities and use them in product filters.
  </Card>

  <Card title="Format output" icon="braces" href="/cli/output">
    Select formats or extract fields with JMESPath.
  </Card>
</Cards>

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.