Automate code review for all Pull Requests using AI.
This step-by-step guide shows how to connect Gito to a GitHub repository for continuous, automated PR reviews.
- Admin access to your GitHub repository.
- An API key for your preferred language model provider (e.g., OpenAI, Google Gemini, Anthropic Claude, etc).
- In your GitHub repository, go to Settings → Secrets and variables → Actions.
- Click New repository secret.
- Enter a name (e.g.
LLM_API_KEY), and paste your API key value. - Click Add secret.
Tip: LLM API keys allow the workflow to analyze code changes using an AI model.
If you don't have the necessary permission, ask a repository administrator to add the secret.
You may use a secret manager (such as HashiCorp Vault) to fetch keys at runtime, but for most teams, GitHub Secrets is the simplest approach.
There are two ways to set up Gito for code reviews in your repository:
- Manually create the workflow file in your repository.
- Use
gito deploycommand locally in the context of your repository and commit the generated workflow files.
Note:
- This requires the
gitoCLI tool to be installed locally.- It will also create the workflow for reacting to the GitHub comments (experimental).
Create a file at .github/workflows/gito-code-review.yml in your repository with the following content:
name: "Gito: AI Code Review"
on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
pr_number:
description: "Pull Request number"
required: true
jobs:
review:
runs-on: ubuntu-latest
permissions: { contents: read, pull-requests: write } # required to post review comments
steps:
- uses: actions/checkout@v6
with: { fetch-depth: 0 }
- name: Set up Python
uses: actions/setup-python@v6
with: { python-version: "3.13" }
- name: Install AI Code Review tool
run: pip install gito.bot~=4.0
- name: Run AI code review
env:
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_API_TYPE: openai
MODEL: "gpt-5.2"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER_FROM_WORKFLOW_DISPATCH: ${{ github.event.inputs.pr_number }}
run: |
gito --verbose review
gito github-comment
- uses: actions/upload-artifact@v6
with:
name: gito-code-review-results
path: |
code-review-report.md
code-review-report.json- Set
LLM_API_TYPEandMODELas needed for your chosen LLM provider (see below for links). - If you used a different secret name in step 1, update
${{ secrets.LLM_API_KEY }}accordingly. - This workflow will:
- Analyze all pull requests using an LLM,
- Post a review summary as a PR comment,
- Upload code review reports as workflow artifacts for you to download if needed.
- Mistral
- Gemini via Google AI Studio
- Gemini via Google Vertex (add
pip install vertexaito your workflow) - Anthropic Claude
Whenever a PR is opened or updated, you'll see an AI-generated code review comment in the PR discussion.
Tips:
- To trigger a review for older existing PRs, merge the
mainbranch containing.github/workflows/gito-code-review.yml - You may close and reopen the PR to trigger the review again.
- Download full review artifacts from the corresponding GitHub Actions workflow run.
- Create a
.gito/config.tomlfile at your repository root to override default configuration. - You can adjust prompts, filtering, report templates, issue criteria, and more.
- Not seeing a PR comment?
- On the PR page, click the status icon near the latest commit hash.
- Click Details to open the Actions run.
- Review logs for any errors (e.g., API key missing, token issues).
Example:
- More usage documentation: README.md
- For help or bug reports, open an issue
Enjoy fast, LLM-powered pull request reviews and safer merges! 🚀

