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

# Getting Started

> Install the Kodus CLI, authenticate, and run your first review.

This guide gets you from zero to a reviewed diff in under five minutes.

**1. Install**

> [tab] Skill Installer (Recommended)
>
> Installs the CLI and deploys Kodus skills to all detected AI agents (Claude Code, Cursor, Codex, Windsurf):
>
> ```bash theme={null}
> curl -fsSL https://review-skill.com/install | bash
> ```

> [tab] npm
>
> ```bash theme={null}
> npm install -g @kodus/cli
> ```

> [tab] npx (No Install)
>
> ```bash theme={null}
> npx @kodus/cli review
> ```

> [tab] curl
>
> ```bash theme={null}
> curl -fsSL https://raw.githubusercontent.com/kodustech/cli/main/install.sh | bash
> ```

> [!NOTE]
>
> Requires Node.js >= 20.0.0.

Verify the install:

```bash theme={null}
kodus --version
kodus status
```

**2. Authenticate**

Pick the path that matches your situation. You can also skip auth and run `kodus review` directly — it works in trial mode with daily limits.

> [tab] Solo developer
>
> Sign in with a personal account:
>
> ```bash theme={null}
> kodus auth login
> ```
>
> The CLI opens the **Authorize Kodus CLI** page in your browser (sign in to Kodus if asked). Check the **Device**, **Mode**, and **Expires** details, click **Authorize CLI**, then return to the terminal.
>
> Tokens are stored in `~/.kodus/credentials.json` and auto-refreshed.

> [tab] Team (shared key)
>
> An organization owner generates a team key in the sidebar under **Organization → CLI keys** ([app.kodus.io/organization/cli-keys](https://app.kodus.io/organization/cli-keys)). Apply it:
>
> ```bash theme={null}
> kodus auth team-key --key kodus_xxxxx
> ```
>
> Or distribute the bootstrap command to your team — it installs the CLI and configures the key in one shot:
>
> ```bash theme={null}
> curl -fsSL https://review-skill.com/install | bash -s -- --team-key kodus_xxxxx
> ```
>
> > [!WARNING]
> >
> > Save the key when it's shown — it won't be displayed again.

> [tab] AI agent
>
> For AI coding agents (Claude Code, Cursor, Codex), team keys are the recommended path — no individual login, no interactive prompts. Set the key once:
>
> ```bash theme={null}
> export KODUS_TEAM_KEY=kodus_xxxxx
> ```
>
> Add it to your shell profile so the agent picks it up on every run.

> [tab] CI/CD
>
> From a logged-in machine, generate a long-lived token:
>
> ```bash theme={null}
> kodus auth token
> ```
>
> In your pipeline, set:
>
> ```bash theme={null}
> export KODUS_TOKEN=<generated-token>
> ```
>
> See [Self-Hosted Setup](https://docs.kodus.io/en/how_to_use/cli/self_hosted.md) for full CI examples.

> [!NOTE]
>
> **Self-hosting Kodus?** Point the CLI to your API before authenticating:
>
> ```bash theme={null}
> export KODUS_API_URL=https://kodus-api.yourcompany.com
> ```
>
> HTTPS is required except for `localhost`.

Confirm the auth state:

```bash theme={null}
kodus auth status
```

**3. Run your first review**

Inside any git repository with uncommitted changes:

```bash theme={null}
kodus review
```

The CLI analyzes your working tree diff, prints a summary, and (in interactive mode) lets you browse file-by-file, preview suggested fixes, and apply them.

Common variations:

```bash theme={null}
kodus review --staged             # Only staged files
kodus review --branch main        # Compare current branch against main
kodus review --commit abc123      # Analyze a single commit
kodus review --fix                # Auto-apply every fixable issue
kodus review --prompt-only        # Compact output for AI agents
kodus review --fail-on error      # Exit non-zero on error-or-worse (CI-friendly)
```

> [!TIP]
>
> Working-tree reviews (default) and `--staged` inline file contents so the backend sees your uncommitted changes. `--branch` and `--commit` modes skip inlining since the backend can fetch those commits itself — this is why those modes work well on huge branches.

**4. Choose what's next**

Depending on your goal:

> [card] [Automate on every push](https://docs.kodus.io/en/how_to_use/cli/commands.md#kodus-hook)
>
> Install the pre-push hook with `kodus hook install`.

> [card] [Run reviews in CI](https://docs.kodus.io/en/how_to_use/cli/self_hosted.md#ci-cd-integration)
>
> GitHub Actions, GitLab CI, and generic pipeline examples.

> [card] [Plug into an AI agent](https://docs.kodus.io/en/how_to_use/cli/ai_agents.md)
>
> Feed `--prompt-only` into Claude Code, Cursor, or Codex for autonomous fix loops.

> [card] [Configure the repo](https://docs.kodus.io/en/how_to_use/cli/commands.md#kodus-config-repo)
>
> Manage ignored files, base branches, and review settings from the CLI.

## Environment Variables

These env vars configure the CLI across all commands.

| Variable | Description |
| - | - |
| `KODUS_API_URL` | API endpoint (default: `https://api.kodus.io`) |
| `KODUS_TEAM_KEY` | Team key for shared access and AI agents |
| `KODUS_TOKEN` | CI/CD token generated via `kodus auth token` |
| `KODUS_VERBOSE` | Set to `true` for verbose output |
| `KODUS_SKIP_HOOK` | Set to `1` to skip the pre-push hook for a single `git push` |
| `KODUS_REQUEST_TIMEOUT_MIN` | Per-request timeout in minutes (default: `60`) |
| `CF_ACCESS_CLIENT_ID` | Cloudflare Access client ID (APIs behind Zero Trust) |
| `CF_ACCESS_CLIENT_SECRET` | Cloudflare Access client secret |

For self-hosted setups, tokens, and Cloudflare Access, see [Self-Hosted Setup](https://docs.kodus.io/en/how_to_use/cli/self_hosted.md).

## Troubleshooting

Ran into an error? Check the [Troubleshooting guide](https://docs.kodus.io/en/how_to_use/cli/troubleshooting.md) for common symptoms and fixes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.