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

autopr-ai

v0.1.10

Published

CLI tool for automated PR review, smart commits, and PR creation

Downloads

822

Readme

autopr-ai⚡

Stop writing commit messages. Stop writing PR descriptions. Start shipping.

npm version license node

AI-powered CLI that watches your repo, generates conventional commits, creates pull requests, and reviews code — all from your terminal.

Install · Quick Start · Commands · Configuration · Contributing


What it does

┌──────────────────────────────────────────────────────────────┐
│                                                              │
│   $ autopr-ai cm                                                │
│                                                              │
│   ⠹ Analyzing changes...                                    │
│   ✔ feat(api): add JWT refresh token rotation               │
│                                                              │
│   Committed: feat(api): add JWT refresh token rotation       │
│                                                              │
├──────────────────────────────────────────────────────────────┤
│                                                              │
│   $ autopr-ai cr                                                │
│                                                              │
│   ⠹ Generating PR content...                                │
│   Title: Implement token refresh with rotation strategy      │
│                                                              │
│   ✔ Created PR #47 → https://github.com/org/repo/pull/47    │
│                                                              │
└──────────────────────────────────────────────────────────────┘

One command to set up, then three commands to ship.

| Command | Alias | What happens | | ---------------- | -------- | --------------------------------------------------------------------------------------- | | autopr-ai onboard | — | First-time setup: GitHub auth + AI provider → ready to go | | autopr-ai cm | commit | Reads your staged diff → generates a conventional commit → commits | | autopr-ai cr | create | Reads your branch diff → generates PR title + description → pushes + creates PR | | autopr-ai watch | — | Polls GitHub → notifies when you're assigned as reviewer → AI review or open in browser |

Plus autopr-ai auth to manage your GitHub token and autopr-ai review to AI-review any PR.


Install

npm (recommended)

npm install -g autopr-ai

Homebrew

brew install @maxxoto/tap/autopr

From source

git clone https://github.com/Maxxoto/autopr-ai.git
cd autopr-ai
npm install
npm link        # makes `autopr` available globally
npx autopr-ai --help

Or use the dev script:

git clone https://github.com/Maxxoto/autopr-ai.git
cd autopr-ai
npm install
npm run autopr -- --help
npm run autopr -- cm          # commit
npm run autopr -- cr          # create PR

Requirements: Node.js 18+


Quick Start

1. Onboard (one-time setup)

$ autopr-ai onboard
  Welcome to autopr! Let's get you set up.
  ════════════════════════════════════════

  Step 1/2: GitHub Authentication
  ────────────────────────────────
  You'll need a Personal Access Token with:
    ✓ repo   (full control of repositories)
    ✓ read:org (read org membership)
  ? Open GitHub token page in browser? Yes
  Opening browser...
  ? Paste your token: ****
  ✔ Authenticated as your-username

  Step 2/2: AI Provider Setup
  ───────────────────────────
  ? Choose your AI provider:
  ❯ OpenAI (GPT-4o) — $$$ Pay-per-use
    Anthropic (Claude Sonnet) — $$$ Pay-per-use
    DeepSeek (DeepSeek Chat) — $ Very affordable
    Groq (Llama 3.3 70B) — Free tier available
    OpenRouter (Multi-model) — $$ Depends on model
    OpenAI-Compatible (LiteLLM/Ollama/Custom) — Free Self-hosted

  ? Enter your OpenAI API key: ****
  ✔ API key saved

  ────────────────────────────────
  ✔ Setup complete!

  Configuration summary:
    GitHub:  your-username @ github.com
    AI:      OpenAI — gpt-4o — sk-...7x3k

  Try these commands:
    autopr-ai cm      — smart commits
    autopr-ai cr      — create PRs
    autopr-ai review  — AI code review
    autopr-ai watch   — watch for reviews

That's it. One command and you're ready to go.

autopr-ai auth login                    # GitHub auth
autopr-ai auth status                   # Check auth state

Set your AI provider via environment variables or ~/.config/autopr/ config.

2. Smart Commit

git add .
autopr-ai cm

The CLI analyzes your staged diff, sends it to your configured LLM, and generates a conventional commit message:

  feat(auth): implement refresh token rotation

  - Add /auth/refresh endpoint
  - Store hashed refresh tokens in database
  - Auto-rotate on each use, revoke after 7 days

  ? Use this commit message? Yes
  ✔ Committed: feat(auth): implement refresh token rotation

Don't like the generated message? Hit No and type your own.

3. Smart PR

autopr-ai cr
  ⠹ Generating PR content...

  Title: Implement refresh token rotation with 7-day expiry

  ## Summary
  Adds secure refresh token handling with automatic rotation
  and a 7-day revocation window.

  ## Changes
  - Add /auth/refresh endpoint with token validation
  - Hash refresh tokens before storage
  - Auto-rotate tokens on each refresh
  - Add cleanup job for expired tokens

  ## Testing
  - Unit tests for token generation and validation
  - Integration test for refresh flow

  ? Create this PR? Yes
  ✔ Created PR #47
  ? Open in browser? Yes

4. Watch for Reviews

autopr-ai watch
  Watching for review requests... (polling every 60s)

  🔔 New review request: "Refactor payment gateway" (org/checkout-api)

  ? PR #52: Refactor payment gateway
  ❯ Open in browser
    AI Review Assist
    Dismiss

Select AI Review Assist and get an instant structured review:

  ## 🔴 Critical
  - Possible hardcoded secrets detected — use environment variables instead

  ## 🟡 Suggestions
  - Large diff (612 additions) — consider splitting into smaller PRs
  - Found 3 TODO comments — consider addressing or creating issues

  ## 🟢 Good Practices
  - Test coverage included
  - No console.log statements left in

Commands

autopr-ai onboard

Guided first-time setup for GitHub auth and AI provider.

autopr-ai onboard    # interactive setup wizard

Running bare autopr with no subcommand will auto-launch onboard if not yet configured.

autopr-ai cm / autopr-ai commit

Generate a conventional commit from staged changes.

autopr-ai cm              # analyze staged diff → commit
autopr-ai cm --no-verify  # skip git hooks

Supports all conventional commit types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.

autopr-ai cr / autopr-ai create

Create a PR with AI-generated title and description.

autopr-ai cr                 # auto-detect base branch
autopr-ai cr --base develop  # target specific branch
autopr-ai cr --draft         # create as draft
autopr-ai cr --no-push       # skip pushing to remote

autopr-ai review [PR number]

AI-powered code review for a pull request.

autopr-ai review          # review PR for current branch
autopr-ai review 42       # review specific PR
autopr-ai review 42 --repo owner/repo

autopr-ai watch

Watch for PR review assignments and get desktop notifications.

autopr-ai watch                  # poll every 60 seconds
autopr-ai watch --interval 30    # poll every 30 seconds

Press Ctrl+C to stop watching.

autopr-ai auth

Manage GitHub authentication.

autopr-ai auth login              # interactive login (opens browser)
autopr-ai auth login --token ghp_ # non-interactive
autopr-ai auth logout              # remove credentials
autopr-ai auth status              # show current auth state

Configuration

AI Providers

autopr supports 6 AI providers through the Vercel AI SDK:

| Provider | Models | Cost | | --------------------- | -------------------------------- | ------------------- | | OpenAI | GPT-4o, o1, o3 | $$$ Pay-per-use | | Anthropic | Claude Sonnet 4, Claude Haiku | $$$ Pay-per-use | | DeepSeek | DeepSeek Chat, DeepSeek Reasoner | $ Very affordable | | Groq | GPT-OSS 20B | Free tier available | | OpenRouter | All providers via single key | $$ Depends on model | | OpenAI-Compatible | LiteLLM, Ollama, any OpenAI API | Free Self-hosted |

Configure via autopr-ai onboard (recommended) or environment variables:

# OpenAI
export OPENAI_API_KEY=sk-...

# Anthropic
export ANTHROPIC_API_KEY=sk-ant-...

# DeepSeek
export DEEPSEEK_API_KEY=dsk-...

# Groq
export GROQ_API_KEY=gsk_...

# OpenRouter
export OPENROUTER_API_KEY=sk-or-...

# OpenAI-Compatible (LiteLLM, Ollama, etc.)
export OPENAI_COMPAT_API_KEY=your-key
export OPENAI_BASE_URL=http://localhost:11434/v1
export OPENAI_MODEL=llama3

Or set in .env:

ANTHROPIC_API_KEY=sk-ant-...
# or any other provider key

GitHub Token

Stored securely at ~/.config/autopr/ (via conf).

The token needs these scopes:

  • repo — full control of repositories (read code, create PRs, post reviews)
  • read:org — read org membership (for team-based review requests)

Create one at: https://github.com/settings/tokens/new?description=autopr-cli&scopes=repo,read:org


Contributing

Interested in contributing? Check out the Contributing Guide for:

  • 🛠️ Development setup
  • 🏗️ Project architecture
  • 📋 Contribution workflow
  • 💡 Ideas for contributions
  • 🧪 Running tests

License

MIT — use it however you want ❤️.


Built for developers who'd rather write code than write about code.

Report a Bug · Request a Feature · Star on GitHub