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

@syedfahadandrabi/commitcraft

v2.0.1

Published

Auto-generate commit messages from git diffs using AI

Downloads

420

Readme

commitcraft

Auto-generate meaningful git commit messages from your staged diff using AI (Claude or Gemini).

npx commitcraft init

Install

npm install -g @syedfahadandrabi/commitcraft

Or use without installing:

npx commitcraft gen

Setup

Configure your API keys:

commitcraft setup

Or set them manually:

# Claude (Anthropic) — recommended, best quality
commitcraft config set ANTHROPIC_API_KEY "sk-ant-..."

# Gemini (Google) — free tier available
commitcraft config set GEMINI_API_KEY "AIza..."

Keys are stored securely in ~/.config/commitcraft/keys.json. Environment variables take precedence over stored keys.


Usage

Install the git hook (recommended)

Works automatically on every git commit:

cd your-project
commitcraft init

Now just stage your changes and commit as usual:

git add .
git commit   # ← message is auto-generated

Generate and commit in one step

Bypasses the editor entirely:

git add .
commitcraft commit

Dry run (preview without committing)

commitcraft gen

With a hint

commitcraft gen --hint "fixing the broken login redirect"

With a commit body (verbose)

commitcraft gen --verbose

Force a provider

commitcraft gen --provider claude
commitcraft gen --provider gemini

Manage API keys

commitcraft config list              # Show stored keys (masked)
commitcraft config delete GEMINI_API_KEY   # Remove a key

Uninstall hook

commitcraft uninstall

Example output

feat(auth): add JWT refresh token rotation

- Replace single-use tokens with rotating refresh token strategy
- Store token family in Redis to detect reuse attacks
- Invalidate entire family on suspicious reuse detection

Commands

| Command | Description | |----------------------|--------------------------------------------------| | commitcraft init | Install git hook in current repo | | commitcraft uninstall | Remove git hook from current repo | | commitcraft commit | Generate message and commit directly | | commitcraft gen | Generate a commit message (dry run) | | commitcraft setup | Interactive API key setup | | commitcraft config | Manage stored API keys (set/list/delete) |

Options for gen and commit

| Flag | Description | |--------------------|--------------------------------------------------| | --hint <text> | Give the AI a hint about what you changed | | --verbose | Include a commit body with bullet points | | --provider <name>| Force provider: claude or gemini |


How it works

  1. commitcraft init installs a prepare-commit-msg git hook in your repo
  2. On every git commit, git runs the hook automatically
  3. The hook calls commitcraft gen --write, which:
    • Runs git diff --cached to get your staged changes
    • Sends the diff to AI (Claude Haiku or Gemini Flash)
    • Writes the generated message to your commit file
  4. Your editor opens pre-filled — edit or accept and save

Provider auto-detection

If no --provider flag is given, commitcraft picks the first available:

  1. ANTHROPIC_API_KEY → Claude
  2. GEMINI_API_KEY → Gemini

Development

npm install
npm run build    # Compile TypeScript
npm test         # Run tests

License

MIT