presubmit/ai-reviewer(opens in a new tab)
Language: TypeScript
Context-aware AI reviewer for Pull Requests. Instant summary, line-by-line comments, title generation and more
- stars
- 187
- watchers
- 2
- forks
- 44
- open issues
- 12
- Last updated
- 09/14/2026
Language: TypeScript
Context-aware AI reviewer for Pull Requests. Instant summary, line-by-line comments, title generation and more
Optimize your code review process with Presubmit's AI Code Reviewer that catches bugs, suggests improvements, and provides meaningful summary - all before human reviewers take their first look.
🤝 Note: Presubmit is designed to complement human reviewers, not replace them. It helps catch security issues and bugs early on while also providing context about the overall change, making the human review process more efficient.
Automated analysis detects potential issues and provides actionable insights:
Interactive discussions help clarify implementation details:
LLM_API_KEYAdd this GitHub Action to your repository by creating .github/workflows/presubmit.yml:
name: Presubmit.ai permissions: contents: read pull-requests: write issues: write on: pull_request_target: types: [opened, synchronize] pull_request_review_comment: types: [created] jobs: review: runs-on: ubuntu-latest steps: - name: Check required secrets run: | if [ -z "${{ secrets.LLM_API_KEY }}" ]; then echo "Error: LLM_API_KEY secret is not configured" exit 1 fi - uses: presubmit/ai-reviewer@latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} LLM_API_KEY: ${{ secrets.LLM_API_KEY }} LLM_MODEL: "claude-sonnet-5"
The action requires:
GITHUB_TOKEN: Automatically provided by GitHub ActionsLLM_API_KEY: Your API key (added in step 1)LLM_MODEL: Which LLM model to use. Make sure the model is supported and matches the LLM_API_KEY.LLM_BASE_URL (optional): Base URL for OpenAI-compatible providers when using LLM_PROVIDER=ai-sdk (e.g., https://openrouter.ai/api/v1 for OpenRouter). Not applicable for sap-ai-sdk provider.To use OpenRouter or other OpenAI-compatible providers with the ai-sdk provider, add the LLM_BASE_URL environment variable. When LLM_BASE_URL is set, requests are routed using the OpenAI-compatible API protocol.
For OpenRouter, specify the full model name with its provider prefix (e.g., anthropic/claude-sonnet-4.5, anthropic/claude-3.7-sonnet, or openai/gpt-4o-mini):
- uses: presubmit/ai-reviewer@latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} LLM_API_KEY: ${{ secrets.OPEN_ROUTER_API_KEY }} LLM_PROVIDER: "ai-sdk" LLM_BASE_URL: "https://openrouter.ai/api/v1" LLM_MODEL: "anthropic/claude-sonnet-4.5"
Note: This configuration only works with LLM_PROVIDER=ai-sdk. It supports any OpenAI-compatible API including OpenRouter, Anyscale, Together AI, Ollama, LiteLLM, vLLM, and others. The sap-ai-sdk provider uses its own SAP_AI_CORE_BASE_URL configuration instead.
If you're using GitHub Enterprise Server, you can configure the action to work with your instance by adding these environment variables:
- uses: presubmit/ai-reviewer@latest env: GITHUB_API_URL: "https://github.example.com/api/v3" GITHUB_SERVER_URL: "https://github.example.com"
You can also configure these settings using input parameters:
- uses: presubmit/ai-reviewer@latest with: github_api_url: "https://github.example.com/api/v3" github_server_url: "https://github.example.com"
Make sure to replace https://github.example.com with your actual GitHub Enterprise Server URL.
@presubmit in PR title for auto-generation@presubmit ignore commentRun the reviewer locally against real PRs using your GitHub authentication.
gh auth login.env file at repo root with:
LLM_API_KEY=... (your API key)LLM_MODEL=... (e.g., claude-sonnet-5, gemini-3.7-flash, gpt-5.6-sol)LLM_PROVIDER=ai-sdk (default)LLM_BASE_URL=... (for OpenAI-compatible providers like OpenRouter)pnpm install pnpm build
List PRs:
pnpm review -- --list-prs --state open --limit 5
Review a PR (dry-run):
pnpm review -- --pr 123 --dry-run
Save output to file:
# Auto-generates filename: dry/pr-123.txt pnpm review -- --pr 123 --dry-run --out # Custom output path pnpm review -- --pr 123 --dry-run --out my-review.txt
Specify repository:
pnpm review -- --pr 123 --owner myorg --repo myrepo --dry-run
Or set in .env:
GITHUB_REPOSITORY=myorg/myrepo
gh auth token automatically--dry-run mode skips all GitHub API writes and logs what would be posted--dry-run, the review will be posted to GitHubGITHUB_REPOSITORY env var or presubmit/ai-reviewerIf you find Presubmit helpful in improving the review process: