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

# CLI Installation

> Install and configure the Orchata CLI

The Orchata CLI lets you manage Spaces, Documents, and Queries from the terminal.

## Prerequisites

* **Node.js 18+** or **Bun** runtime
* An Orchata account and API key ([get one here](https://app.orchata.ai))

## Install

<CodeGroup>
  ```bash npm theme={null}
  npm install -g @orchata-ai/cli
  ```

  ```bash bun theme={null}
  bun add -g @orchata-ai/cli
  ```

  ```bash pnpm theme={null}
  pnpm add -g @orchata-ai/cli
  ```

  ```bash yarn theme={null}
  yarn global add @orchata-ai/cli
  ```
</CodeGroup>

Verify the installation:

```bash theme={null}
orchata --version
```

## Quick Start

```bash theme={null}
# 1. Set up your cloud configuration
orchata init

# 2. Authenticate with your API key
orchata login

# 3. List your spaces
orchata spaces list

# 4. Upload a document to a space
orchata documents upload ./docs/handbook.md --space space_123

# 5. Query a space
orchata query "How do I authenticate?" --space space_123
```

## Configuration

The CLI stores configuration in `~/.orchata/config.json`. You can also set values via environment variables:

| Environment Variable | Description            |
| -------------------- | ---------------------- |
| `ORCHATA_API_BASE`   | Override API base URL  |
| `ORCHATA_API_KEY`    | Override API key       |
| `ORCHATA_PROFILE`    | Select a named profile |

## Global Options

These options can be used with any command:

| Option             | Description                   |
| ------------------ | ----------------------------- |
| `--profile <name>` | Use a named profile           |
| `--api-base <url>` | Override API base URL         |
| `--app-base <url>` | Override app base URL         |
| `--api-key <key>`  | Override API key for this run |
| `--json`           | Output raw JSON               |

## Next Steps

<CardGroup cols={2}>
  <Card title="Command Reference" icon="terminal" href="/cli/commands">
    Full reference for all CLI commands.
  </Card>

  <Card title="Authentication" icon="key" href="/getting-started/authentication">
    Learn about API keys and permissions.
  </Card>
</CardGroup>
