# Installation guide

AI Code Reviews in CLI lets you run fast, high-quality AI-powered code reviews directly from your terminal. It works on **macOS, Linux, and Windows**, and installation typically takes a few minutes.

This guide walks you through installation steps.

## Prerequisites

{% stepper %}
{% step %}

### Bito API Key (aka Bito Access Key)

You'll need a **Bito account** and a **Bito Access Key** to authenticate AI Code Reviews in CLI. You can sign up for a Bito account at [**https://alpha.bito.ai**](https://alpha.bito.ai/), and create an access key from [**Settings -> Advanced Settings**](https://alpha.bito.ai/home/advanced)

* [**View Guide**](https://docs.bito.ai/help/account-and-settings/access-key)
  {% endstep %}
  {% endstepper %}

## Installation guide

{% stepper %}
{% step %}

### Download and install the CLI

#### macOS and Linux:

Open a **terminal** and run the following command:

```shellscript
curl -fsSL https://bitoreview.bito.ai/install.sh | bash
```

#### Windows:

Open **PowerShell 7** and run the following command:

```shellscript
irm https://bitoreview.bito.ai/install.ps1 | iex
```

{% hint style="info" %}
**Note:** For Windows, AI Code Reviews in CLI currently supports **PowerShell 7** only. If you don't have it installed, you can download it from the Microsoft Store:

* [Install PowerShell 7](https://apps.microsoft.com/detail/9MZ1SNWT0N5D?hl=en-us\&gl=US\&ocid=pdpshare)
  {% endhint %}

{% hint style="info" %}
**Tip:** If you encounter execution policy errors, run PowerShell 7 as Administrator or allow script execution temporarily.
{% endhint %}

***

#### What gets installed:

The installer will:

1. Download the CLI binary for your platform
2. Install it in a user-local directory:
   * **macOS/Linux:** `~/.bitoreview/bin/`
   * **Windows:** `%USERPROFILE%\.bitoreview\bin\`
3. Add the binary to your **PATH** so the `bitoreview` command is available globally
4. Install **bito-wingman** (the AI engine) if it is not already present
5. Create a `br` alias for quick access
6. Automatically configures the usage guidelines globally for **Claude Code** and **Windsurf** (if detected). For other supported IDEs (such as Cursor, VS Code, etc.), you need to add the guidelines manually at the project level. See the commands given below in **Add guidelines** section.
   {% endstep %}

{% step %}

### Add guidelines

The [guidelines file](https://bitoreview.bito.ai/bito_cli_review_guidelines.md) is a set of instructions that tells your AI coding agent (Claude Code, Cursor, etc.) how to correctly run `bitoreview` command when you ask it to do a code review. It defines the expected workflow, such as always using `--prompt-only` for structured JSON output, waiting for the review to complete before responding, grouping issues by severity, and validating problems in the actual code before suggesting fixes. Without these guidelines, the AI coding agent may not know how to use Bito's AI Code Reviews in CLI.

#### Global configuration (auto-applied during install)

During setup, the installer **automatically adds the usage guidelines globally** for the following AI coding agents if they are detected on your system:

<table><thead><tr><th width="179" align="center">AI Coding Agent</th><th>Guidelines file location</th></tr></thead><tbody><tr><td align="center"><strong>Claude Code</strong></td><td><code>~/.claude/CLAUDE.md</code></td></tr><tr><td align="center"><strong>Windsurf</strong></td><td><code>~/.codeium/windsurf/memories/global_rules.md</code></td></tr></tbody></table>

#### Project-level configuration (manual, per-project)

For all other supported IDEs such as **Cursor, VS Code (GitHub Copilot), Junie, and JetBrains AI Assistant**, you need to add the guidelines manually inside each project directory where you want them to apply.

Navigate to your project root, then run the relevant command:

**Cursor:**

* **macOS / Linux:**

  ```shellscript
  cd /path/to/your/project
  curl -fsSL https://bitoreview.bito.ai/bito_cli_review_guidelines.md -o .cursorrules
  ```
* **Windows:**

  ```shellscript
  cd C:\path\to\your\project
  irm 'https://bitoreview.bito.ai/bito_cli_review_guidelines.md' | Out-File -FilePath .cursorrules
  ```

**Windsurf:**

* **macOS / Linux:**

  ```shellscript
  cd /path/to/your/project
  mkdir -p .windsurf/rules
  curl -fsSL https://bitoreview.bito.ai/bito_cli_review_guidelines.md -o .windsurf/rules/bitoai-review.md
  ```
* **Windows:**

  ```shellscript
  cd C:\path\to\your\project
  New-Item -ItemType Directory -Path .windsurf\rules -Force
  irm 'https://bitoreview.bito.ai/bito_cli_review_guidelines.md' | Out-File -FilePath .windsurf\rules\bitoai-review.md
  ```

**VS Code (GitHub Copilot):**

* **macOS / Linux:**

  ```shellscript
  cd /path/to/your/project
  mkdir -p .github
  curl -fsSL https://bitoreview.bito.ai/bito_cli_review_guidelines.md -o .github/copilot-instructions.md
  ```
* **Windows:**

  ```shellscript
  cd C:\path\to\your\project
  New-Item -ItemType Directory -Path .github -Force
  irm 'https://bitoreview.bito.ai/bito_cli_review_guidelines.md' | Out-File -FilePath .github\copilot-instructions.md
  ```

**Junie:**

* **macOS / Linux:**

  ```shellscript
  cd /path/to/your/project
  mkdir -p .junie
  curl -fsSL https://bitoreview.bito.ai/bito_cli_review_guidelines.md -o .junie/guidelines.md
  ```
* **Windows:**

  ```shellscript
  cd C:\path\to\your\project
  New-Item -ItemType Directory -Path .junie -Force
  irm 'https://bitoreview.bito.ai/bito_cli_review_guidelines.md' | Out-File -FilePath .junie\guidelines.md
  ```

**JetBrains AI Assistant:**

* **macOS / Linux:**

  ```shellscript
  cd /path/to/your/project
  mkdir -p .aiassistant/rules
  curl -fsSL https://bitoreview.bito.ai/bito_cli_review_guidelines.md -o .aiassistant/rules/bitoai-review.md
  ```
* **Windows:**

  ```shellscript
  cd C:\path\to\your\project
  New-Item -ItemType Directory -Path .aiassistant\rules -Force
  irm 'https://bitoreview.bito.ai/bito_cli_review_guidelines.md' | Out-File -FilePath .aiassistant\rules\bitoai-review.md
  ```

{% endstep %}

{% step %}

### Reload your terminal environment

To make the CLI available immediately, restart your terminal or reload your shell configuration.

#### macOS / Linux:

Restart your terminal or run:

```shellscript
# Bash
source ~/.bashrc

# Zsh (macOS default)
source ~/.zshrc
```

#### Windows:

* Restart **PowerShell 7**\
  **or**
* Run `refreshenv` if **Chocolatey** is installed
  {% endstep %}

{% step %}

### Verify installation

Confirm that the CLI is installed correctly:

```shellscript
bitoreview --version
```

The installer also creates a shortcut alias:

```shellscript
br --version
```

{% hint style="info" %}
Both commands should return the same version.
{% endhint %}
{% endstep %}

{% step %}

### Authentication setup

To run code reviews, the CLI requires a valid [**Bito API key (aka Bito Access Key)**](https://docs.bito.ai/help/account-and-settings/access-key).

#### Get Bito API key:

You can sign up for a Bito account at [**https://alpha.bito.ai**](https://alpha.bito.ai/), and create an access key from [**Settings -> Advanced Settings**](https://alpha.bito.ai/home/advanced)

* [**View Guide**](https://docs.bito.ai/help/account-and-settings/access-key)

***

#### Configure the Bito API key:

You can configure authentication in multiple ways.

* **Method 1: Interactive setup (recommended)** - You'll be prompted to paste your [Bito API key](https://docs.bito.ai/help/account-and-settings/access-key) securely.

```shellscript
bitoreview config set-api-key
```

* **Method 2: Direct CLI setup** - Useful for automation or scripted setups.

```shellscript
bitoreview config set-api-key YOUR_API_KEY_HERE
```

{% hint style="info" %}
**Note:** replace `YOUR_API_KEY_HERE` with your actual [Bito API key](https://docs.bito.ai/help/account-and-settings/access-key).
{% endhint %}

* **Method 3: Environment variable** - Useful for CI/CD pipelines, shared machines, temporary or project-specific credentials

```shellscript
export BITO_API_KEY=YOUR_API_KEY_HERE
```

{% hint style="info" %}
**Note:** replace `YOUR_API_KEY_HERE` with your actual [Bito API key](https://docs.bito.ai/help/account-and-settings/access-key).
{% endhint %}

***

#### Verify your Bito API key:

To confirm your Bito API key is configured correctly, run:

```shellscript
bitoreview config show-api-key
```

***

#### Bito API key resolution priority

If multiple API keys are configured, the CLI resolves them in the following order:

1. **Command-line flag**: `--api-key YOUR_KEY`
2. **Environment variable**: `BITO_API_KEY`
3. **Stored configuration file**: `~/.bitowingman/env`

This makes it easy to override credentials per command, project, or environment.
{% endstep %}

{% step %}

### Next steps

You’re now ready to run AI-powered code reviews from your terminal.

* [**How to use?**](https://docs.bito.ai/ai-code-reviews-in-cli/how-to-use) – Run your first code review
* [**Available commands**](https://docs.bito.ai/ai-code-reviews-in-cli/available-commands) – Complete reference of CLI commands
* [**Troubleshooting**](https://docs.bito.ai/ai-code-reviews-in-cli/troubleshooting) – Common issues and how to resolve them
  {% endstep %}
  {% endstepper %}
