npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ai-pr-review

v0.2.0

Published

AI-powered git PR reviewer using Claude or Gemini

Readme

ai-pr-review

AI-powered code reviewer for git pull requests. Runs locally, reviews your branch diff using Gemini or Claude, and prints findings to your terminal.

Install

npm install -g ai-pr-review

Or run without installing:

npx ai-pr-review

Quick start

1. Get an API key

2. Set your key

export GEMINI_API_KEY=your_key_here
# or
export ANTHROPIC_API_KEY=your_key_here

3. Run on your branch

cd your-project
git checkout your-feature-branch
ai-pr-review

That's it. It diffs your branch against main and prints the review.

Options

--base <branch>       Base branch to diff against        [default: main]
--provider <name>     AI provider: gemini | anthropic    [default: gemini]
--model <model>       Override the default model
--fail-on <severity>  Exit 1 if issues found at severity [default: major]
--ci                  CI mode: JSON output + exit codes
--post                Post review as GitHub PR comment
--pr <number>         GitHub PR number (skips auto-detection)
--exclude <patterns>  Comma-separated globs to skip
--config <path>       Path to .prreview.json
--debug               Verbose logging

Config file

Drop a .prreview.json in your repo root to avoid typing flags every time:

{
  "provider": "gemini",
  "baseBranch": "main",
  "failOnSeverity": "major",
  "excludePatterns": ["**/*.lock", "**/dist/**"],
  "customInstructions": "This is a TypeScript project. Focus on type safety."
}

All config options

| Field | Type | Default | Description | | -------------------- | ------------------------------------ | -------------------- | -------------------------------------------- | | provider | gemini \| anthropic | gemini | AI provider | | model | string | provider default | Override model | | baseBranch | string | main | Branch to diff against | | excludePatterns | string[] | ["**/*.lock", ...] | Glob patterns to skip | | failOnSeverity | critical \| major \| minor \| none | major | Exit code 1 threshold | | postToGitHub | boolean | false | Post review to GitHub PR | | githubRepo | string | — | Repo in "owner/repo" format (for --post) | | ciMode | boolean | false | JSON output mode | | customInstructions | string | — | Extra instructions for the AI | | reviewFocus | string[] | — | Focus areas: security, correctness, etc. |

Config priority (highest wins)

CLI flags > environment variables > .prreview.json > built-in defaults

Environment variables

| Variable | Description | | ----------------------- | ---------------------------------------------------- | | GEMINI_API_KEY | Required when using Gemini | | ANTHROPIC_API_KEY | Required when using Anthropic | | GITHUB_TOKEN | Required for --post (needs repo + pull_requests scopes) | | PRREVIEW_GITHUB_REPO | Repo in owner/repo format — required for --post | | PRREVIEW_PR_NUMBER | Manually set PR number (skips auto-detection) | | PRREVIEW_PROVIDER | Override provider | | PRREVIEW_MODEL | Override model | | PRREVIEW_BASE_BRANCH | Override base branch | | PRREVIEW_POST | Set to true to enable GitHub posting | | CI=true | Auto-enables CI mode |

GitHub posting setup

To post reviews directly onto your PR:

1. Create a GitHub token Go to github.com/settings/tokens/new and create a token with repo and pull_requests scopes.

2. Set env vars

export GITHUB_TOKEN=your_token_here
export PRREVIEW_GITHUB_REPO=your-org/your-repo

3. Run with --post

ai-pr-review --post

The tool auto-detects the open PR for your current branch. Or pass --pr 42 to specify manually.

Exit codes

| Code | Meaning | | ---- | ------------------------------------------------- | | 0 | Review done, no issues at/above failOnSeverity | | 1 | Issues found at/above failOnSeverity | | 2 | Tool error (bad config, git missing, API failure) |

CI usage

# GitHub Actions example
- name: Review PR
  env:
    GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    PRREVIEW_GITHUB_REPO: ${{ github.repository }}
  run: npx ai-pr-review --ci --fail-on major --post

License

MIT