Skip to content
OpenSmartRoute
Skillv1.0.0

coderabbit-local-dev-loop

Configure CodeRabbit CLI for local pre-commit code reviews and fast iteration. Use when setting up local development with CodeRabbit CLI reviews, integrating AI review into your commit workflow, or te

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/coderabbit-local-dev-loop/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill coderabbit-local-dev-loop. Copyright stays with the author (MIT).

CodeRabbit Local Dev Loop

Overview

Use CodeRabbit CLI to review code locally before opening a PR. The CLI provides the same AI-powered review as the GitHub App but runs in your terminal against staged or unstaged changes. This creates a multi-layered review process: local CLI review before commit, then automated PR review after push.

Prerequisites

  • CodeRabbit CLI installed (curl -fsSL https://cli.coderabbit.ai/install.sh | sh)
  • Git repository with .coderabbit.yaml configuration
  • CodeRabbit account (CLI uses credits: $0.25 per file reviewed)

Instructions

Step 1: Install and Verify CLI

set -euo pipefail
# Install CodeRabbit CLI
curl -fsSL https://cli.coderabbit.ai/install.sh | sh

# Verify installation
cr --version

# Authenticate (opens browser for OAuth)
cr auth login

Step 2: Local Review Workflow

set -euo pipefail
# Review all staged changes (most common workflow)
git add -A
cr review

# Review specific files only
cr review src/api/routes.ts src/middleware/auth.ts

# Interactive mode: ask follow-up questions about review feedback
cr review --interactive

# Plain output mode (pipe to other tools or AI agents)
cr review --prompt-only

Step 3: Git Hook Integration

#!/bin/bash
# .git/hooks/pre-push (make executable: chmod +x .git/hooks/pre-push)
set -euo pipefail

echo "Running CodeRabbit pre-push review..."

# Get list of changed files vs remote
CHANGED_FILES=$(git diff --name-only @{push}.. 2>/dev/null || git diff --name-only HEAD~1)

if [ -n "$CHANGED_FILES" ]; then
  echo "$CHANGED_FILES" | xargs cr review

  # Non-blocking: show review but don't prevent push
  # To make blocking, check exit code:
  # echo "$CHANGED_FILES" | xargs cr review || {
  #   echo "CodeRabbit found issues. Push anyway? (y/n)"
  #   read -r response
  #   [ "$response" != "y" ] && exit 1
  # }
fi

Step 4: Configuration for Local Development

# .coderabbit.yaml - Settings that affect both CLI and PR reviews
language: "en-US"
reviews:
  profile: "assertive"
  path_instructions:
    - path: "src/**"
      instructions: "Check for proper error handling and type safety."
    - path: "tests/**"
      instructions: "Verify edge cases and assertion completeness."
  path_filters:
    - "!**/*.lock"
    - "!dist/**"
    - "!**/*.generated.*"
  auto_review:
    enabled: true
    drafts: false
chat:
  auto_reply: true

Step 5: IDE Integration Pattern

// .vscode/tasks.json - Run CodeRabbit review from VS Code
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "CodeRabbit: Review Current File",
      "type": "shell",
      "command": "cr review ${file}",
      "presentation": { "reveal": "always", "panel": "shared" },
      "problemMatcher": []
    },
    {
      "label": "CodeRabbit: Review Staged Changes",
      "type": "shell",
      "command": "cr review",
      "presentation": { "reveal": "always", "panel": "shared" },
      "problemMatcher": []
    }
  ]
}

Two-Layer Review Strategy

Developer writes code
       │
       ▼
┌──────────────────┐
│ cr review (local) │  ← Layer 1: Fast feedback before commit
│ Fix obvious issues│
└────────┬─────────┘
         │
         ▼
   git commit + push
         │
         ▼
┌──────────────────┐
│ CodeRabbit App   │  ← Layer 2: Full context review on PR
│ (automated PR    │
│  review)         │
└──────────────────┘

Output

  • CodeRabbit CLI installed and authenticated
  • Pre-push git hook for automated local reviews
  • VS Code task integration for on-demand reviews
  • Two-layer review workflow (local + PR)

Error Handling

Issue Cause Solution
cr: command not found CLI not in PATH Re-run install script or add to PATH
Auth token expired Session timeout Run cr auth login again
"No credits remaining" Usage-based billing exhausted Purchase credits at app.coderabbit.ai
Review hangs on large file File too large for AI context Review specific files instead of all
Empty review output No changed files detected Stage changes with git add first

Examples

Run the CLI against one non-sensitive changed file in a local feature branch, review the output before committing, and use the pull-request app as the separate authoritative review layer. If the CLI lacks credits, authentication, or context, skip the local automation and rely on the configured PR workflow; do not paste repository secrets or large private files into an alternate tool.

Resources

Next Steps

See coderabbit-sdk-patterns for PR interaction automation patterns.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-coderabbit-lo-af8270/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-coderabbit-lo-af8270.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-coderabbit-lo-af8270",
  "kind": "skill",
  "name": "coderabbit-local-dev-loop",
  "description": "Configure CodeRabbit CLI for local pre-commit code reviews and fast iteration. Use when setting up local development with CodeRabbit CLI reviews, integrating AI review into your commit workflow, or testing config changes. Trigger with phrases like \"coderabbit dev setup\", \"coderabbit local development\", \"coderabbit CLI workflow\", \"coderabbit pre-commit review\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "saas",
      "coderabbit",
      "cli",
      "workflow",
      "development",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Configure CodeRabbit CLI for local pre-commit code reviews and fast iteration. Use when setting up local development with CodeRabbit CLI reviews, integrating AI review into your commit workflow, or testing config changes. Trigger with phrases like \"coderabbit dev setup\", \"coderabbit local development\", \"coderabbit CLI workflow\", \"coderabbit pre-commit review\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/coderabbit-local-dev-loop/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/coderabbit-local-dev-loop/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/coderabbit-local-dev-loop/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit,",
      "Bash(cr:*),",
      "Bash(git:*),",
      "Bash(npm:*),",
      "Grep"
    ],
    "license": "MIT"
  },
  "instructions": "# CodeRabbit Local Dev Loop\n\n## Overview\n\nUse CodeRabbit CLI to review code locally before opening a PR. The CLI provides the same AI-powered review as the GitHub App but runs in your terminal against staged or unstaged changes. This creates a multi-layered review process: local CLI review before commit, then automated PR review after push.\n\n## Prerequisites\n\n- CodeRabbit CLI installed (`curl -fsSL https://cli.coderabbit.ai/install.sh | sh`)\n- Git repository with `.coderabbit.yaml` configuration\n- CodeRabbit account (CLI uses credits: $0.25 per file reviewed)\n\n## Instructions\n\n### Step 1: Inst",
  "cost": {
    "context_tokens": 1212
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-coderabbit-lo-af8270/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.