Self-hosted AI code review for GitHub pull requests.
Cloudflare-native, queue-backed, repository-aware, and built for teams that want to own their review engine.
Website | Docs | Installation | Issues | Contributing
Codra listens to GitHub pull request events, runs AI-powered review jobs, posts inline findings back to the PR, and gives you a dashboard to inspect jobs, repositories, model routing, review history, and failed queue runs.
Beta -- Codra is under active development. Expect rough edges, missing features, and breaking changes between releases. Feedback and bug reports are welcome via GitHub Issues.
- Own the whole review loop: Run the GitHub App, Cloudflare Worker, queue, database, model credentials, and dashboard under your own control.
- Review with repository context: Codra checks pull request diffs for correctness, security, performance, maintainability, and repo-specific patterns.
- Configure each repository: Tune triggers, skipped paths, draft handling, mention reviews, labels, custom rules, and review budgets from the dashboard.
- Route models deliberately: Use global defaults, per-repo model chains, fallbacks, and size-based overrides for larger pull requests.
- Operate the system: Inspect job history, PR findings, webhook deliveries, queue failures, DLQ replay, model usage, and dashboard stats.
- Automatic reviews on
opened,synchronize,ready_for_review, andreopenedpull request events - Mention-triggered reviews for on-demand analysis
- Inline GitHub review comments plus summary reviews and check run updates
- Queue-backed processing through Cloudflare Queues
- Dead letter queue inspection, replay, and purge workflows
- GitHub OAuth dashboard authentication
- Durable storage on Cloudflare D1 (SQLite)
- Dashboard-managed LLM providers for OpenAI, OpenRouter, Anthropic, Google, and Cloudflare models
- Repository settings for labels, skipped globs, custom rules, and model routing
- GitHub sends Codra a pull request webhook.
- Codra verifies the signature and loads repository review settings.
- A review job is stored in Cloudflare D1 and queued on Cloudflare Queues.
- The Worker consumes the job, fetches the PR diff, runs model review passes, and formats findings.
- Codra posts inline comments and a summary review back to GitHub.
- The dashboard keeps the job history, findings, logs, stats, and replay tools available for operators.
- Worker: Cloudflare Workers, Hono, Wrangler
- Dashboard: React, Vite, Tailwind CSS, Radix UI, Recharts
- Data: Cloudflare D1 (SQLite), Cloudflare KV
- Queues: Cloudflare Queues with DLQ workflows
- Models: OpenAI, OpenRouter, Anthropic, Google, and Cloudflare providers
- GitHub: GitHub App webhooks, checks, reviews, and OAuth
- Quality: TypeScript, Zod, Vitest, Playwright browser tests
- Installation: Use
pnpm installto install dependencies. - Running: Start the local development server (client and worker) using
npm run dev. Generate database migrations withnpm run db:generateand apply them usingnpm run migrate:local. - Testing: Run the test suite (Vitest + Playwright) via
npm testor in watch mode usingnpm run test:watch. No external database is needed, as tests run on an in-memory SQLite D1 instance.
The internal documentation suite lives in the docs/ directory. It includes documents like ROADMAP.md, REBUILD-PLAN.md, and other guides used during development. For the source-aware review engines (OpenCode on your Mac via Workers VPC/Tunnel, or the all-Cloudflare Computer engine), see docs/opencode-setup.md.
- The review pipeline (
src/server/core/review.ts) has two opt-out toggles inconfig.review:jules.enabled(docs-gap → Jules session, launched only on PR merge) anddeployWorkflow.enabled(separatecodra/deploy-workflow-*PR adding.github/workflows/deploy.yml). Both default totrue— seesrc/server/core/jules.ts,src/server/core/jules-docs-gap.ts, andsrc/server/core/deploy-workflow.ts. - Auto-setting the
CLOUDFLARE_ACCOUNT_ID/CLOUDFLARE_API_TOKENActions secrets (src/server/core/github-secrets.ts) requires the GitHub App's Actions Secrets: write permission; without it, Codra writes the secret names and setup steps into the deploy-workflow PR body instead.
- Install dependencies:
pnpm install - Start the local development server:
npm run dev
Execute the test suite (Vitest and Playwright) using: npm test
Codra uses pnpm for dependency management.
- Install dependencies:
pnpm install
- Database setup:
Generate and apply the local SQLite schema using D1:
pnpm run db:generate pnpm run migrate:local
- Run locally:
Start the local development server (client and worker):
pnpm run dev
- Run tests:
Execute the test suite (Vitest and Playwright):
pnpm test
The full setup and operations guides live at codra.run/docs. The internal documentation suite for the repository (such as the rebuild plan and roadmap) lives in the docs/ directory at the repository root.
For local setup and architectural context, see the docs/ suite in this repository.
The full setup and operations guides live at codra.run/docs.
Contributions are welcome. Please read CONTRIBUTING.md before opening a pull request against dev. Codra uses a Contributor License Agreement for contributions.
Codra is licensed under the GNU Affero General Public License v3.0.
