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

# Install the Upstack CLI

> Install the upstack CLI and configure it with an API key and pixel id.

The `upstack` CLI is a thin wrapper around the [Upstack API](/api-reference/overview). It handles authentication, profile management, and a few ergonomics like measure-title resolution that the raw API leaves to the caller.

The CLI is designed to be both a human tool and a target for AI agents. See [AI agent workflow](/cli/ai-agent-workflow) for the intended Claude-in-your-terminal use case.

## Install

```bash theme={null}
npm install -g @upstackdata/upstack-cli
```

## Configure

```bash theme={null}
upstack init
```

You'll be prompted for:

* **API Key** — your Upstack key (starts with `upstack_`). Mint at **Settings → API Keys** in the dashboard.
* **Pixel ID** — the pixel uuid the key is scoped to.

Credentials live in `~/.upstackrc` with file mode `0600`.

## Verify

```bash theme={null}
upstack whoami
```

Prints the active profile, pixel id, and masked API key. If you see your pixel id, you're set — try [`upstack measures`](/cli/measures) next.

## Multiple profiles

For additional environments or pixels:

```bash theme={null}
upstack init --profile staging
upstack init --profile client-b
```

Then pass `--profile <name>` on any command. See [Profiles](/cli/profiles) for the full reference.
