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

# CLI Overview

> Install Outkit, sign in, and wire your project from the terminal

The Outkit CLI is the **fastest and recommended way** to set up Outkit. One command detects
your framework, installs the right SDK, picks a profile, generates an API key, and writes the
proxy endpoint your app needs — no dashboard tab-switching, no manual config.

```bash theme={null}
npm install -g @outkit-dev/cli@latest
outkit login
outkit init
```

## Install

<Tabs>
  <Tab title="npm">
    ```bash theme={null}
    npm install -g @outkit-dev/cli@latest
    ```
  </Tab>

  <Tab title="pnpm">
    ```bash theme={null}
    pnpm add -g @outkit-dev/cli@latest
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={null}
    yarn global add @outkit-dev/cli@latest
    ```
  </Tab>

  <Tab title="bun">
    ```bash theme={null}
    bun add -g @outkit-dev/cli@latest
    ```
  </Tab>
</Tabs>

Verify the install:

```bash theme={null}
outkit --help
```

## Sign in

```bash theme={null}
outkit login
```

`outkit login` runs a device-code flow: it opens your browser to the dashboard, you approve
the device, and a token is saved to `~/.outkit/credentials.json` (mode `0600`).

Confirm your setup:

```bash theme={null}
outkit whoami
# user, team, and active device
outkit doctor
# end-to-end health check: auth, network, project mode, SDK, wire format
```

## What the CLI Does

<CardGroup cols={2}>
  <Card title="Project setup" icon="rocket" href="/docs/cli/setup">
    `outkit init` detects your framework, picks a profile, installs the SDK, and writes the
    backend proxy.
  </Card>

  <Card title="API keys" icon="key" href="/docs/cli/keys">
    `outkit keys create / rotate / revoke / stats` — manage every key without leaving the
    terminal.
  </Card>

  <Card title="Theme sync" icon="palette" href="/docs/cli/theme">
    `outkit theme detect / apply / sync` — pull design tokens from your codebase straight
    into your Outkit profile.
  </Card>

  <Card title="Local development" icon="terminal" href="/docs/cli/dev">
    `outkit dev`, `outkit logs tail`, `outkit doctor` — run alongside your dev server.
  </Card>

  <Card title="Full reference" icon="book" href="/docs/cli/reference">
    Every command, flag, env var, and config file the CLI reads or writes.
  </Card>
</CardGroup>

## Files the CLI Manages

| Path                         | Purpose                                                                                 | Commit?   |
| ---------------------------- | --------------------------------------------------------------------------------------- | --------- |
| `outkit.json`                | Repo-local config: `version`, `mode`, `teamId`, `profileId`, `backendUrl?`, `themeMap?` | yes       |
| `outkit.theme.json`          | Local copy of the active profile's design tokens                                        | yes       |
| `~/.outkit/credentials.json` | Auth token (mode `0600`)                                                                | **never** |
| `~/.outkit/undo.json`        | Append-only journal feeding `outkit undo`                                               | **never** |
| `~/.outkit/telemetry.log`    | Local NDJSON log of analytics events                                                    | **never** |

## Environment Overrides

| Variable                    | Default                  | When to set                                |
| --------------------------- | ------------------------ | ------------------------------------------ |
| `OUTKIT_API_BASE_URL`       | `https://api.outkit.dev` | Staging or self-hosted backends            |
| `OUTKIT_DASHBOARD_BASE_URL` | `https://app.outkit.dev` | Match an API override                      |
| `OUTKIT_DEBUG`              | *unset*                  | Set to `1` to print stack traces on errors |

## Next Steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="bolt" href="/docs/quickstart">
    Five minutes from `outkit init` to your first enhanced response.
  </Card>

  <Card title="Project setup" icon="folder" href="/docs/cli/setup">
    What `outkit init` writes, framework support, and the `outkit.json` schema.
  </Card>
</CardGroup>
