Skip to main content

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

This guide covers installing and using CodeRabbit CLI on WSL. For integration with AI coding assistants, see Claude Code integration, Cursor integration, or Codex integration.

Why use CodeRabbit CLI on WSL

Native Linux environment

Run CodeRabbit in a genuine Linux environment on Windows without dual-booting or virtual machines.

Windows development workflow

Access your Windows files and integrate with Windows-based IDEs while using Linux command-line tools.

Expert issue detection

CodeRabbit spots race conditions, memory leaks, and logic errors that generic linters miss. Same pattern recognition that powers our PR reviews.

Git integration

Work with git repositories in WSL, maintaining full compatibility with Windows-based git clients and IDEs.

Prerequisites

1

Install WSL

If you haven’t already installed WSL, open PowerShell or Windows Command Prompt as Administrator and run:
wsl --install
This installs Ubuntu by default. Restart your computer when prompted.For other distributions or manual installation, see Microsoft’s WSL installation guide.
2

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).
3

Verify prerequisites

Ensure you have curl and unzip available (typically pre-installed in WSL):
curl --version
unzip -v
If curl or unzip are not installed:
sudo apt update && sudo apt install curl unzip

Installation

1

Install CodeRabbit CLI

In your WSL terminal, install the CodeRabbit CLI globally:
curl -fsSL https://cli.coderabbit.ai/install.sh | sh
The installer automatically detects your shell and adds CodeRabbit to your PATH.
2

Restart your shell

Reload your shell configuration:
# For bash (default in most WSL distributions)
source ~/.bashrc

# For zsh (if you've switched shells)
source ~/.zshrc
3

Verify installation

Confirm CodeRabbit is installed and accessible:
coderabbit --version
You should see the current version number.

Authentication

1

Start authentication

Begin the authentication process:
coderabbit auth login
CodeRabbit displays a URL and waits for authentication.
2

Open the authentication URL

The URL is clickable in most WSL terminals. If not, copy and paste it into your Windows web browser.
Windows Terminal and modern WSL terminals support clickable links. If your terminal doesn’t, manually copy the URL.
3

Complete authentication

Log in to CodeRabbit in your browser and copy the authentication token.Paste the token back into your WSL terminal.
4

Verify authentication

Check your authentication status:
coderabbit auth status
Success shows your login status and confirms authentication is working.

Usage workflow

Running code reviews

1

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)
cd ~/projects/my-repo
# or
cd /mnt/c/Users/YourName/projects/my-repo
WSL can access Windows files via /mnt/c/, /mnt/d/, etc. Performance is better with files in the Linux filesystem (~), but both work.
2

Run CodeRabbit review

Analyze your code changes:
coderabbit
CodeRabbit analyzes tracked git changes and provides detailed feedback.
3

Review the output

CodeRabbit displays:
  • Issues found with severity levels
  • File locations and line numbers
  • Suggested fixes and improvements
  • Code quality insights

Review options

Control what CodeRabbit analyzes:
# 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

# Get AI-optimized output (useful for AI coding assistants)
coderabbit --prompt-only

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
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.

Git configuration

If you use git in both Windows and WSL, you may need to configure line endings:
# 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:
    ls -la ~/.coderabbit/bin/coderabbit
    
  2. Reload shell configuration:
    source ~/.bashrc
    # or
    source ~/.zshrc
    
  3. Manually add to PATH (if needed):
    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
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.

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:
wsl coderabbit --version
wsl -e bash -c "cd ~/projects/my-repo && coderabbit"

Set up VSCode 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
I