# Codra Full Documentation Codra is a self-hosted AI reviewer that understands your repository's structure, enforces your patterns, and flags bugs before they ship on every pull request. ## Codra open source code review engine ### Self-hosted AI pull request reviews Codra reviews pull requests on your infrastructure, using repository context to flag bugs, security issues, performance risks, and correctness problems before they ship. - [Install Codra](/docs/installation) - [Read the documentation](/docs) ### How Codra works Install the GitHub App, connect your repositories, and Codra receives pull request webhooks, performs deep analysis, and posts inline review comments directly on GitHub. ### Capabilities Codra combines security analysis, architectural context, configurable model routing, queue-backed processing, and full job history in an AGPL-licensed code review system. ## Sign the Codra Contributor License Agreement ### Contributor agreement for Codra Codra contributors sign a short CLA that confirms they can submit their work and grants the project the rights needed to include contributions under its licensing model. - [Sign the CLA](/cla) ### Contributor rights Contributors retain copyright ownership of their work. The agreement is associated with a verified GitHub identity and enforced automatically on pull requests. ## Codra documentation ### Why Codra Codra is built for teams that want to own their review engine, model choices, job history, GitHub App, Cloudflare Worker, PostgreSQL database, and operational settings. - [Installation guide](/docs/installation) - [Configuration guide](/docs/configuration) - [Providers guide](/docs/providers) - [Deploy with Neon](/docs/neon) ### Documentation topics The docs cover installation, environment variables, repository review policy, dashboard-managed providers, encrypted provider keys, custom endpoints, DB-backed model routing, Neon and Hyperdrive deployment, operations, troubleshooting, and contribution guidelines. ## Install Codra ### Installation prerequisites Codra requires a Cloudflare account, a PostgreSQL database, a GitHub App, Worker runtime secrets, and an encryption key for dashboard-managed provider credentials. ### Deployment steps Create the GitHub App, configure OAuth and webhooks, prepare PostgreSQL, bind Cloudflare resources, set Worker secrets, run migrations, and deploy with Wrangler. - [Configure Codra](/docs/configuration) - [Deploy to Neon](/docs/neon) ## Configure Codra ### Environment variables Codra separates platform/runtime secrets such as GitHub credentials, KV, queues, Workers AI, Cloudflare API credentials, and provider-key encryption from dashboard-managed LLM provider credentials. ### Repository review config Repository-level settings control pull request triggers, draft handling, mention reviews, skipped files, review budgets, focus categories, labels, and custom rules. ### Model routing Codra builds an ordered model chain from DB-backed Codra model IDs, then maps each route to provider-specific model names configured in the dashboard. - [Providers guide](/docs/providers) ## Codra providers ### Provider types Codra supports Cloudflare native Workers AI, Google Gemini-compatible APIs, Anthropic, OpenAI, OpenRouter, and custom OpenAI-, Anthropic-, or Gemini-compatible endpoints. - [Configuration guide](/docs/configuration) ### Credentials and catalogs Provider API keys are entered in Settings, encrypted before PostgreSQL storage, and never returned in plaintext. Cloudflare runtime inference uses the Worker AI binding, while catalog refresh uses Cloudflare API credentials. - [Deploy with Neon](/docs/neon) ## Deploy Codra with Neon ### Neon PostgreSQL setup Create a Neon project, choose a region, retrieve the pooled connection string, and use it as Codra’s production PostgreSQL database. ### Cloudflare Hyperdrive Use Cloudflare Hyperdrive to pool and accelerate database connections from the Worker runtime, then bind the Hyperdrive ID in wrangler.jsonc. - [Installation guide](/docs/installation) ## Operate Codra ### Review lifecycle Codra creates review jobs from pull request events and mention-triggered issue comments, then fetches diffs, reviews files, posts summaries, and updates checks. ### Troubleshooting The operations guide covers webhook failures, missing jobs, mention review issues, dashboard login problems, repository sync errors, provider call failures, fallback chains, inline comment fallbacks, and dead-letter queue access. - [Contributing guide](/docs/contributing) ## Contribute to Codra ### Contribution workflow Fork the repository, create a focused branch, install dependencies, make a scoped change, run typecheck and tests, then open a pull request. ### CLA and security Contributors must sign the Codra CLA before merge. Security vulnerabilities should be reported privately rather than opened as public issues. - [Sign the CLA](/cla)