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

# WSL on Windows

> Install and configure the CodeRabbit CLI on Windows Subsystem for Linux (WSL) to bring AI code reviews to your Windows development environment.

## CodeRabbit CLI on WSL

The CodeRabbit CLI runs on Windows Subsystem for Linux (WSL), allowing you to access AI code reviews in your development environment. WSL provides a full Linux environment on Windows, making it ideal for running command-line tools like CodeRabbit.

## Video of install steps

<iframe className="w-full aspect-video rounded-xl" src="https://www.youtube.com/embed/HlWNGpQ2P8U" title="CodeRabbit CLI on WSL for Windows" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

<Info>
  This guide covers installing and using CodeRabbit CLI on WSL. For integration
  with AI coding assistants, see [Claude Code
  integration](/cli/claude-code-integration), [Cursor
  integration](/cli/cursor-integration), or [Codex
  integration](/cli/codex-integration).
</Info>

## Why use CodeRabbit CLI on WSL

<CardGroup cols={2}>
  <Card title="Native Linux environment" icon="linux">
    Run CodeRabbit in a genuine Linux environment on Windows without dual-booting or virtual machines.
  </Card>

  <Card title="Windows development workflow" icon="windows">
    Access your Windows files and integrate with Windows-based IDEs while using
    Linux command-line tools.
  </Card>

  <Card title="Expert issue detection" icon="search">
    CodeRabbit spots race conditions, memory leaks, and logic errors that generic
    linters miss. Same pattern recognition that powers our PR reviews.
  </Card>

  <Card title="Git integration" icon="git-branch">
    Work with git repositories in WSL, maintaining full compatibility with Windows-based git clients and IDEs.
  </Card>
</CardGroup>

## Prerequisites

<Steps>
  <Step title="Install WSL">
    If you haven't already installed WSL, open PowerShell or Windows Command Prompt as Administrator and run:

    ```powershell theme={null}
    wsl --install
    ```

    This installs Ubuntu by default. Restart your computer when prompted.

    For other distributions or manual installation, see [Microsoft's WSL installation guide](https://docs.microsoft.com/en-us/windows/wsl/install).
  </Step>

  <Step title="Launch WSL">
    Open your WSL distribution (e.g., Ubuntu) from the Start menu or by running `wsl` in PowerShell/Command Prompt.

    Set up your Linux username and password when prompted (first launch only).
  </Step>

  <Step title="Verify prerequisites">
    Ensure you have curl and unzip available (typically pre-installed in WSL):

    ```bash theme={null}
    curl --version
    unzip -v
    ```

    If curl or unzip are not installed:

    ```bash theme={null}
    sudo apt update && sudo apt install curl unzip
    ```
  </Step>
</Steps>

## Installation

<Steps>
  <Step title="Install CodeRabbit CLI">
    In your WSL terminal, install the CodeRabbit CLI globally:

    ```bash theme={null}
    curl -fsSL https://cli.coderabbit.ai/install.sh | sh
    ```

    The installer automatically detects your shell and adds CodeRabbit to your PATH.
  </Step>

  <Step title="Restart your shell">
    Reload your shell configuration:

    ```bash theme={null}
    # For bash (default in most WSL distributions)
    source ~/.bashrc

    # For zsh (if you've switched shells)
    source ~/.zshrc
    ```
  </Step>

  <Step title="Verify installation">
    Confirm CodeRabbit is installed and accessible:

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

    You should see the current version number.
  </Step>
</Steps>

## Authentication

<Steps>
  <Step title="Start authentication">
    Begin the authentication process:

    ```bash theme={null}
    coderabbit auth login
    ```
  </Step>

  <Step title="Complete sign-in in your browser">
    A browser window opens automatically in most WSL setups. If your terminal or browser configuration does not open it for you, use the URL displayed in the terminal to continue in your Windows browser.

    Sign in to CodeRabbit in the browser. Authentication completes automatically.
  </Step>

  <Step title="Verify authentication">
    Check your authentication status:

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

    Success shows your login status and confirms authentication is working.
  </Step>
</Steps>

## Usage workflow

### Running code reviews

<Steps>
  <Step title="Navigate to your repository">
    In WSL, navigate to your git repository. This can be:

    * A repository in your Linux home directory (`~/projects/my-repo`)
    * A repository in your Windows filesystem (accessed via `/mnt/c/Users/YourName/projects/my-repo`)

    ```bash theme={null}
    cd ~/projects/my-repo
    # or
    cd /mnt/c/Users/YourName/projects/my-repo
    ```

    <Tip>
      WSL can access Windows files via `/mnt/c/`, `/mnt/d/`, etc. Performance is better with files in the Linux filesystem (`~`), but both work.
    </Tip>
  </Step>

  <Step title="Run CodeRabbit review">
    Analyze your code changes:

    ```bash theme={null}
    coderabbit
    ```

    CodeRabbit analyzes tracked git changes and provides detailed feedback.
  </Step>

  <Step title="Review the output">
    CodeRabbit displays:

    * Issues found with severity levels
    * File locations and line numbers
    * Suggested fixes and improvements
    * Code quality insights
  </Step>
</Steps>

### Review options

Control what CodeRabbit analyzes:

```bash theme={null}
# Plain mode (default)
coderabbit

# Explicit plain mode
coderabbit --plain

# Structured output for coding agents
coderabbit --agent

# Interactive terminal UI
coderabbit --interactive

# Review only uncommitted changes
coderabbit --type uncommitted

# Review only committed changes
coderabbit --type committed

# Review all changes (default)
coderabbit --type all

# Specify a different base branch
coderabbit --base develop
```

## Working with Windows tools

### Using Windows-based IDEs

You can edit files in Windows IDEs (VS Code, Visual Studio, etc.) while running CodeRabbit reviews in WSL:

1. **Open your project in Windows**: Use your preferred Windows IDE
2. **Run reviews in WSL**: Keep a WSL terminal open for running CodeRabbit
3. **Seamless file sync**: Changes in Windows immediately reflect in WSL

<Tip>
  VS Code has excellent WSL integration via the "Remote - WSL" extension,
  allowing you to run the terminal in WSL while editing in the Windows UI.
  Install the extension from the VS Code marketplace to keep everything in sync
  between your Windows UI and WSL environment.
</Tip>

### Git configuration

If you use git in both Windows and WSL, you may need to configure line endings:

```bash theme={null}
# In WSL
git config --global core.autocrlf input
```

This prevents line-ending conflicts between Windows and Linux.

## Troubleshooting

### CodeRabbit command not found

If `coderabbit` isn't recognized after installation:

1. **Verify installation**: Check if the binary exists:

   ```bash theme={null}
   ls -la ~/.coderabbit/bin/coderabbit
   ```

2. **Reload shell configuration**:

   ```bash theme={null}
   source ~/.bashrc
   # or
   source ~/.zshrc
   ```

3. **Manually add to PATH** (if needed):
   ```bash theme={null}
   echo 'export PATH="$HOME/.coderabbit/bin:$PATH"' >> ~/.bashrc
   source ~/.bashrc
   ```

### Authentication URL not clickable

If the authentication URL isn't clickable in your terminal:

1. **Copy manually**: Select and copy the URL, then paste into your Windows browser
2. **Upgrade terminal**: Consider using Windows Terminal for better WSL integration
3. **Alternative authentication**: The authentication process is browser-based, so any modern browser works

### Slow performance on Windows files

If CodeRabbit runs slowly when working with files in `/mnt/c/`:

1. **Move repository to Linux filesystem**: Copy your project to `~/projects/` for better performance
2. **Use WSL 2**: Ensure you're running WSL 2 (check with `wsl -l -v` in PowerShell)
3. **Consider git clone in WSL**: Clone repositories directly in WSL's filesystem

<Note>
  File operations in `/mnt/c/` (Windows filesystem) are slower than in the Linux
  filesystem (`~`). For best performance, work with repositories in your WSL
  home directory.
</Note>

### CodeRabbit not finding issues

If CodeRabbit isn't detecting expected issues:

1. **Check authentication status**: Run `coderabbit auth status` (authentication improves review quality but isn't required)
2. **Verify git status**: CodeRabbit analyzes tracked changes - check `git status`
3. **Consider review type**: Use the `--type` flag to specify what to review:
   * `coderabbit --type uncommitted` - only uncommitted changes
   * `coderabbit --type committed` - only committed changes
   * `coderabbit --type all` - both committed and uncommitted (default)
4. **Specify base branch**: If your main branch isn't `main`, use `--base`:
   * `coderabbit --base develop`
   * `coderabbit --base master`
5. **Review file types**: CodeRabbit focuses on code files, not docs or configuration

## Advanced: WSL integration tips

### Access WSL from Windows Explorer

You can access your WSL files from Windows Explorer:

* Type `\\wsl$\` in the Explorer address bar
* Navigate to your distribution (e.g., `\\wsl$\Ubuntu\home\username\`)

### Run CodeRabbit from Windows PowerShell

You can invoke WSL commands from Windows PowerShell:

```powershell theme={null}
wsl coderabbit --version
wsl -e bash -c "cd ~/projects/my-repo && coderabbit"
```

### Set up VS Code Remote - WSL

For the best development experience:

1. Install the "Remote - WSL" extension in VS Code
2. Open a WSL terminal and navigate to your project
3. Run `code .` to open VS Code in WSL mode
4. Use the integrated terminal to run CodeRabbit commands
