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

commitdiff

v1.0.1

Published

AI-powered git commit message generator

Readme

CommitDiff CLI

npm version npm downloads License: MIT

AI-powered git commit message generator for your terminal.

Stop wasting time writing commit messages. Let AI analyze your code changes and generate professional, conventional commits in seconds.


🚀 Quick Start

Installation

# Install globally
npm install -g commitdiff

# Or use with npx (no installation required)
npx commitdiff

Usage

# Stage your changes
git add .

# Generate commit message
commitdiff

# Or auto-commit with the generated message
commitdiff --commit

That's it! CommitDiff will analyze your staged changes and generate a professional commit message.


📖 Features

  • Lightning Fast - Generate commit messages in under 2 seconds
  • 🎯 Conventional Commits - Follows conventional commit standards automatically
  • 🤖 AI-Powered - Uses GPT-4o-mini to understand your code changes
  • 🔒 Privacy First - Your code is never stored, only processed
  • 💻 Zero Config - Works out of the box, no setup required
  • 🌐 Language Agnostic - Works with any programming language

🔧 Commands & Options

Basic Command

commitdiff [options]

Options

| Option | Description | Default | | ---------------- | ------------------------------------------- | ------- | | --commit | Automatically commit with generated message | false | | --style <type> | Commit style:conventional | short | | -V, --version | Output the version number | - | | -h, --help | Display help for command | - |

Examples

# Generate a conventional commit message
commitdiff

# Generate and auto-commit
commitdiff --commit

# Use detailed commit style
commitdiff --style detailed

# Use short commit style
commitdiff --style short

📝 Example Output

Input (your staged changes)

git add src/auth.ts
commitdiff

Output

🔍 Analyzing staged changes...

🤖 Generating commit message with AI...

✨ Generated Commit Message:

📝 feat(auth): add JWT token validation middleware

Summary:
• Implemented JWT token verification in auth middleware
• Added error handling for expired and invalid tokens
• Updated authentication flow to use new validation

────────────────────────────────────────────────────────────

💻 To commit with this message, run:
git commit -m "feat(auth): add JWT token validation middleware"

🎯 How It Works

  1. Stage your changes - Use git add to stage the files you want to commit
  2. Run commitdiff - The CLI reads your staged diff and sends it to our AI
  3. Get your message - Receive a professional, conventional commit message
  4. Commit - Use the generated message or auto-commit with --commit
┌─────────────┐      ┌─────────────┐      ┌─────────────┐
│  git add    │ ───> │ commitdiff  │ ───> │ AI Analysis │
│  (stage)    │      │   (reads)   │      │  (generate) │
└─────────────┘      └─────────────┘      └─────────────┘
                                                  │
                                                  v
                                          ┌─────────────┐
                                          │ git commit  │
                                          │  (apply)    │
                                          └─────────────┘

🔐 Privacy & Security

  • No Storage - Your code diffs are never stored on our servers
  • Secure Processing - All requests use HTTPS encryption
  • No Tracking - We don't track or analyze your code
  • Open Source - Full transparency, view the code

💡 Tips & Best Practices

1. Stage Meaningful Changes

# Good - stage related changes together
git add src/auth/ tests/auth.test.ts

# Avoid - staging everything at once
git add .  # Only if changes are related

2. Review Before Committing

Always review the generated message before committing. The AI is smart, but you know your code best.

3. Use Auto-commit Wisely

# Use auto-commit for quick iterations
commitdiff --commit

# But review important changes manually
commitdiff  # then copy and edit if needed

4. Combine with Git Hooks

Add commitdiff to your git hooks for team consistency:

# .git/hooks/prepare-commit-msg
#!/bin/bash
commitdiff > .git/COMMIT_EDITMSG

🌐 Web Interface

Prefer a web interface? Try our online version at commitdiff.vercel.app


🤝 Contributing

We welcome contributions! Here's how you can help:

  1. Report Bugs - Open an issue
  2. Suggest Features - Request a feature
  3. Submit PRs - Contributing guide

📚 Related Resources


📋 Requirements

  • Node.js 18.0.0 or higher
  • Git installed and configured
  • Active internet connection (for AI processing)

❓ FAQ

🐛 Troubleshooting

"No staged changes found"

# Make sure you've staged your changes first
git add <files>

"Failed to generate commit message"

  • Check your internet connection
  • Verify you're in a git repository
  • Try again (rate limit may have been hit)

"Command not found: commitdiff"

# Reinstall globally
npm install -g commitdiff

# Or use npx
npx commitdiff

📄 License

MIT License - see LICENSE for details.


👨‍💻 Author

Timothy Okoduwa


Star on GitHub • 🐦 Follow on Twitter • 🌐 Try Online