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

commit-sage

v1.3.0

Published

AI-powered CLI that reviews staged Git changes before commit

Readme

commit-sage

AI-powered code reviewer for your staged Git changes. Runs as a CLI or pre-commit hook — catches bugs, security issues, and performance problems before they get committed.

Unlike platform-based reviewers (CodeRabbit, Copilot), commit-sage reviews before the commit — the earliest possible point in your workflow. No GitHub App, no PR required. Just stage your files and run it.

Quick Start

# Install and run — works immediately, no API key needed
npm install -g commit-sage
git add .
commit-sage

That's it. Out of the box, commit-sage uses a free Cloudflare-hosted backend — zero configuration required.

Want to use your own API key for a different provider? Just set it:

export GEMINI_API_KEY=your-key-here
commit-sage   # auto-detects Gemini

Or run the interactive setup wizard:

commit-sage init

You'll see something like:

🤖 AI review (cloudflare worker)

✔ Review complete.

src/auth.ts:45 — [Security] JWT secret is hardcoded. Fix: move to environment variable.
src/users.ts:23 — [Bug] Missing null check on req.params.id. Fix: validate before DB query.

If everything looks good, it just says LGTM.

Providers

commit-sage supports multiple providers. The free Cloudflare backend is the default — no key needed.

| Provider | API Key | Priority | |----------|---------|:--------:| | Cloudflare | none needed | default | | Gemini | GEMINI_API_KEY | 1st auto-detect | | OpenAI | OPENAI_API_KEY | 2nd auto-detect | | Anthropic | ANTHROPIC_API_KEY | 3rd auto-detect | | Moonshot (Kimi) | MOONSHOT_API_KEY | 4th auto-detect |

Resolution order: .commitsagerc config → env var auto-detect → Cloudflare default.

To override on the fly:

commit-sage --provider gemini --key AIza...

Or create a .commitsagerc for permanent config:

{ "ai": { "provider": "openai" } }

Setup Wizard

The init command walks you through everything:

commit-sage init

It will:

  • Let you pick a provider
  • Help you configure your API key
  • Write .commitsagerc for you
  • Optionally install a pre-commit hook

Use as Git Hook

Block bad commits automatically:

# With Husky
npm install husky --save-dev
npx husky init
echo 'npx commit-sage --hook' > .husky/pre-commit
# Or manually
echo '#!/bin/sh
npx commit-sage --hook' > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

When --hook is used and the AI finds real bugs, the commit is blocked (exit code 1).

CLI Flags

commit-sage [command] [options]

Commands:
  init                  Interactive setup wizard

Options:
  -h, --help            Show help
  --hook                Git hook mode (exit 1 on issues)
  --provider <name>     Override provider for this run
  --key <api-key>       Pass API key directly (one-time, not stored)

Supported Languages

Works with any language. Gives extra-specific hints for:

TypeScript / JavaScript / Python / Go / Rust / Java / C# / Ruby / PHP / Swift / Kotlin

The language is auto-detected from file extensions.

Advanced Config

All fields are optional:

{
  "ai": {
    "provider": "gemini",
    "model": "gemini-2.0-flash",
    "fullContext": true,
    "diffContext": 10,
    "strictness": "block"
  }
}

| Field | Default | What it does | |-------|---------|-------------| | provider | cloudflare | AI provider to use | | model | auto | Override the AI model | | fullContext | true | Send full file contents for better reviews | | diffContext | 10 | Lines of context around each change | | strictness | "block" | "block" = block commits on issues, "warn" = always allow |

Self-Hosted Cloudflare Worker

If you prefer to run your own backend instead of using the default free one:

cd worker/
npm install -g wrangler
wrangler login
wrangler deploy

Then point your config to it:

{
  "ai": {
    "provider": "cloudflare",
    "proxyUrl": "https://your-worker.your-subdomain.workers.dev"
  }
}

The worker includes IP-based rate limiting (20 requests/hour per IP).

How It Works

  1. Reads your staged files and their full contents
  2. Detects the dominant language and builds a tailored prompt
  3. Sends the diff + full file context to the AI
  4. Prints real bugs only — no style nitpicks, no false positives

License

MIT