| 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".
|
| allowed-tools | Read, Write, Edit, Bash(cr:*), Bash(git:*), Bash(npm:*), Grep |
| version | 1.11.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","coderabbit","cli","workflow","development"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
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
curl -fsSL https://cli.coderabbit.ai/install.sh | sh
cr --version
cr auth login
Step 2: Local Review Workflow
set -euo pipefail
git add -A
cr review
cr review src/api/routes.ts src/middleware/auth.ts
cr review --interactive
cr review --prompt-only
Step 3: Git Hook Integration
#!/bin/bash
set -euo pipefail
echo "Running CodeRabbit pre-push review..."
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