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

# CLI Introduction

> Install the gcai CLI, authenticate, and run your first command against the GC AI API from the terminal.

`gcai` is the command-line client for the GC AI API. Every command maps to a REST endpoint, so anything you can do over the API you can do from your terminal, with tab-completable commands, typed flags, and human-readable output.

Reach for the CLI for quick one-off calls, shell scripts, and piping results into other tools. For a long-running integration or an AI assistant working on your behalf, the [REST API](/api-reference/introduction) and [MCP server](/api-reference/mcp/overview) are the better fit.

## Install

Requires Node.js 22 or newer.

<CodeGroup>
  ```bash Global theme={null}
  npm install -g @gcai/cli
  gcai --help
  ```

  ```bash npx theme={null}
  npx @gcai/cli --help
  ```
</CodeGroup>

## Quickstart

<Steps>
  <Step title="Authenticate">
    ```bash theme={null}
    gcai auth login
    ```

    This opens **Settings → API** in your browser so you can create an API key, then you paste it back. See [Authentication](/api-reference/cli/authentication) for details.
  </Step>

  <Step title="Verify">
    ```bash theme={null}
    gcai ping
    ```
  </Step>

  <Step title="Run a command">
    ```bash theme={null}
    gcai chat create "Summarize the key risks in this contract" --file-ids <file_id>
    ```

    `chat create` waits for the answer and prints it. Add `--json` for raw output you can pipe to `jq`.
  </Step>
</Steps>

## Finding your way around

* **[Surface map](/api-reference/cli/surface-map)** lists every command at a glance.
* **[Commands](/api-reference/cli/commands/chat)** gives the full synopsis and flags for each command, grouped by resource.
* Concepts worth reading once: [Authentication](/api-reference/cli/authentication), [Output and scripting](/api-reference/cli/output), and [Async and polling](/api-reference/cli/async).

Every command also accepts the global flags `--json` (raw JSON output), `--api-key`, and `--base-url`.
