Skip to content

datarootsio/nitpick-senior

Repository files navigation

Nitpick Senior

Nitpick Senior

Um, actually... AI-powered code review that catches what you missed

FeaturesQuick StartGit PlatformsLLM ProvidersConfiguration


An AI-powered code reviewer that works across multiple Git platforms. It analyzes code changes and posts inline comments on issues, bugs, and best practice violations.

Features

  • Multi-platform: Works with GitHub, GitLab, Azure DevOps, and Bitbucket
  • Flexible LLM support: Use OpenAI, Anthropic, Azure OpenAI directly, or access 200+ models via OpenRouter
  • Powered by Pydantic AI: Structured outputs with automatic validation and retries
  • Language agnostic: Review behavior is defined by an agent spec file in your repo
  • Static analysis integration: Enrich reviews with Semgrep findings
  • Inline comments: Posts comments directly on problematic lines
  • PR summaries: Generates a brief summary of the changes
  • Cost tracking: Logs token usage and estimated costs
  • Smart filtering: Filter comments by severity, auto-resolve outdated comments

Quick Start

  1. Add a CI pipeline for your platform:
GitHub Actions

Create .github/workflows/nitpick-senior.yml:

name: Nitpick Senior Review

on:
  pull_request:
    types: [opened, synchronize]

permissions:
  contents: read
  pull-requests: write

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: datarootsio/nitpick-senior@v1
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          model: gpt-4o
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GitLab CI

Create .gitlab-ci.yml:

nitpick-senior:
  image: python:3.12-slim
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
  script:
    - pip install nitpick-senior
    - nitpick-senior review
      --platform gitlab
      --project-id $CI_PROJECT_ID
      --mr-id $CI_MERGE_REQUEST_IID
      --model gpt-4o
  variables:
    OPENAI_API_KEY: $OPENAI_API_KEY
    GITLAB_TOKEN: $GITLAB_TOKEN
Azure DevOps Pipelines

Create azure-pipelines.yml:

trigger: none

pr:
  branches:
    include:
      - main

pool:
  vmImage: ubuntu-latest

steps:
  - task: UsePythonVersion@0
    inputs:
      versionSpec: '3.12'

  - script: |
      pip install nitpick-senior
      nitpick-senior review \
        --platform azure-devops \
        --organization $(System.CollectionUri) \
        --project $(System.TeamProject) \
        --repo $(Build.Repository.Name) \
        --pr-id $(System.PullRequest.PullRequestId) \
        --model gpt-4o
    env:
      OPENAI_API_KEY: $(OPENAI_API_KEY)
      AZURE_DEVOPS_TOKEN: $(System.AccessToken)
Bitbucket Pipelines

Create bitbucket-pipelines.yml:

pipelines:
  pull-requests:
    '**':
      - step:
          name: Nitpick Senior Review
          image: python:3.12-slim
          script:
            - pip install nitpick-senior
            - nitpick-senior review
              --platform bitbucket
              --workspace $BITBUCKET_WORKSPACE
              --repo $BITBUCKET_REPO_SLUG
              --pr-id $BITBUCKET_PR_ID
              --model gpt-4o
          variables:
            OPENAI_API_KEY: $OPENAI_API_KEY
            BITBUCKET_TOKEN: $BITBUCKET_TOKEN
  1. (Optional) Create an agent spec file to customize review behavior:
# Nitpick Senior Configuration

You are a senior code reviewer for this project.

## What to Review
- Security vulnerabilities
- Performance issues
- Logic errors
- Best practice violations

## Project Context
- This is a Python FastAPI backend
- We use SQLAlchemy for ORM

## Do NOT Comment On
- Formatting (handled by Black)
- Import ordering (handled by isort)

Git Platforms

Nitpick Senior works with all major Git platforms:

Platform Documentation Status
GitHub Setup Guide Full support
GitLab Setup Guide Full support
Azure DevOps Setup Guide Full support
Bitbucket Setup Guide Full support

See the Provider Overview for feature comparison across platforms.

Inputs

Input Required Default Description
github_token Yes - GitHub token for API access
model Yes - Model string (see LLM Providers)
agent_spec_path No .github/ai-reviewer.md Path to agent spec file
post_summary No true Post PR summary comment
post_inline_comments No true Post inline review comments
max_comments No 10 Maximum inline comments to post
min_severity No warning Minimum severity to post (error, warning, info)
static_analysis_file No - Path to semgrep JSON output (docs)

LLM Providers

Nitpick Senior uses Pydantic AI for LLM interactions, providing structured outputs with automatic validation.

Direct Providers

Provider Model Format Required Environment Variables
OpenAI gpt-4o OPENAI_API_KEY
Anthropic anthropic/claude-sonnet-4-5-20250929 ANTHROPIC_API_KEY
Azure OpenAI azure/gpt-4o AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT

OpenRouter (200+ Models)

OpenRouter provides access to models from OpenAI, Anthropic, Google, Meta, Mistral, and many more through a single API.

Provider Model Format Required Environment Variables
OpenRouter openrouter/anthropic/claude-3.5-sonnet OPENROUTER_API_KEY

Browse available models at openrouter.ai/models.

Local Development

# Install dependencies
uv sync

# Run tests
uv run pytest

# Run linter
uv run ruff check src/

About

Github action to review PRs

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors