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

# CoinGecko CLI

> A high-performance terminal interface for real-time and historical crypto data

<Frame>
  <img src="https://mintcdn.com/coingecko/i9l2MT4etZGYjSx8/assets/images/cli-hero.png?fit=max&auto=format&n=i9l2MT4etZGYjSx8&q=85&s=4c3dfb6ae43d49907ffcf77d79e8a925" noZoom width="1134" height="366" data-path="assets/images/cli-hero.png" />
</Frame>

A fast, full-featured terminal interface for developers, analysts, and AI agents. Interactive dashboards, CSV exports, WebSocket streaming, and machine-readable JSON output — all from the command line.

[GitHub →](https://github.com/coingecko/coingecko-cli) | [Commands Reference →](https://github.com/coingecko/coingecko-cli#commands)

<CardGroup cols={2}>
  <Card icon="chart-line" title="Interactive TUI">
    Full-screen terminal dashboard with live navigation and 7-day braille price charts.
  </Card>

  <Card icon="file-csv" title="CSV & JSON Export">
    Export market rankings and historical data directly to CSV or JSON for pipelines and analysis.
  </Card>

  <Card icon="bolt-lightning" title="Live WebSocket Streaming">
    Real-time price updates via `cg watch` with NDJSON output for piping.
  </Card>

  <Card icon="robot" title="AI Agent-Friendly">
    `--dry-run` mode and `cg commands` for tool discovery and LLM integration.
  </Card>
</CardGroup>

## Get Started

<Steps>
  <Step title="Install">
    <CodeGroup>
      ```bash Homebrew theme={null}
      brew install coingecko/coingecko-cli/cg
      ```

      ```bash npm theme={null}
      npm install -g @coingecko/cg
      ```

      ```bash Bash wrap theme={null}
      curl -sSfL https://raw.githubusercontent.com/coingecko/coingecko-cli/main/install.sh | sh
      ```

      ```bash Go theme={null}
      go install github.com/coingecko/coingecko-cli@latest
      ```
    </CodeGroup>

    > Or download a binary from [GitHub Releases](https://github.com/coingecko/coingecko-cli/releases).
  </Step>

  <Step title="Authenticate">
    Get a [Demo (free) or Pro (paid) API key](https://www.coingecko.com/en/api/pricing), then run:

    ```bash theme={null}
    cg auth
    ```

    Or pass credentials directly:

    <CodeGroup>
      ```bash Demo (Free) theme={null}
      cg auth --key YOUR_API_KEY --tier demo
      ```

      ```bash Pro (Paid) theme={null}
      cg auth --key YOUR_API_KEY --tier paid
      ```
    </CodeGroup>

    Verify with `cg status`.
  </Step>

  <Step title="Try it out">
    ```bash theme={null}
    cg price --ids bitcoin,ethereum
    cg markets --total 100
    cg history bitcoin --days 7
    cg tui markets
    ```

    > See the full [Commands Reference](https://github.com/coingecko/coingecko-cli#commands) for all available commands.
  </Step>
</Steps>

## Use Cases

<AccordionGroup>
  <Accordion title="Developers — monitoring and tooling">
    * **CI/CD alerts** — integrate into GitHub Actions or cron jobs, monitor price thresholds with `-o json` and `jq`
    * **Dataset generation** — fetch and export top 1000 coins to CSV in seconds
    * **Debugging** — use `--dry-run` to preview exact API parameters and URLs before production code
    * **Shell integration** — embed in your terminal prompt for live metrics
  </Accordion>

  <Accordion title="AI Agents — data retrieval and reasoning">
    * **Function calling** — give your LLM the `cg` binary as a tool, resolve symbols via `cg search`, and analyze results
    * **Market research** — identify hot sectors with `cg trending`, drill into performers with `--category`
    * **Context injection** — feed fresh `-o json` data to ensure reasoning uses real-time market conditions
    * **Self-documentation** — `cg commands` lets agents discover available sub-commands
  </Accordion>

  <Accordion title="Analysts — data pipelines">
    * **Historical snapshots** — generate CSV reports for specific dates or ranges for Excel or Python
    * **Movers analysis** — track biggest gainers/losers across timeframes
    * **Category benchmarking** — export sector data (Layer-2, RWA, etc.) for cross-category comparison
  </Accordion>
</AccordionGroup>

***

<CardGroup cols={2}>
  <Card title="Share Feedback" icon="comment" href="https://forms.gle/VgpVbwsSJLgE7D8Q7">
    Tell us how you're using the CLI and what we should improve.
  </Card>

  <Card title="Open an Issue or PR" icon="github" href="https://github.com/coingecko/coingecko-cli">
    Report bugs, request features, or contribute on GitHub.
  </Card>
</CardGroup>
