| name | coderabbit-sdk-patterns |
| description | Apply production-ready CodeRabbit automation patterns using GitHub API and PR comments.
Use when building automation around CodeRabbit reviews, processing review feedback
programmatically, or integrating CodeRabbit into custom workflows.
Trigger with phrases like "coderabbit automation", "coderabbit API patterns",
"automate coderabbit", "coderabbit github api", "process coderabbit reviews".
|
| allowed-tools | Read, Write, Edit, Bash(gh:*), Bash(node:*) |
| version | 1.11.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","coderabbit","automation","github-api","typescript"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
CodeRabbit SDK Patterns
Overview
CodeRabbit does not have a traditional SDK. You interact with it through .coderabbit.yaml configuration, PR comment commands (@coderabbitai), and the GitHub/GitLab API to process its review output. These patterns show how to automate around CodeRabbit reviews programmatically.
Prerequisites
- CodeRabbit installed on repository (see
coderabbit-install-auth)
- GitHub CLI (
gh) or GitHub API access via personal access token
- Node.js 18+ for automation scripts
Instructions
Step 1: Fetch CodeRabbit Reviews via GitHub API
import { Octokit } from "@octokit/rest";
const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN });
async function getCodeRabbitReview(owner: string, repo: string, prNumber: number) {
const reviews = await octokit.pulls.listReviews({ owner, repo, pull_number: prNumber });
const coderabbitReview = reviews.data.find(
(r) => r.user?.login === "coderabbitai[bot]"
);
if (!coderabbitReview) {
console.log();
;
}
{
: coderabbitReview.,
: coderabbitReview.,
: coderabbitReview.,
};
}