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

craftcommit-cli

v0.4.1

Published

Generate AI-powered commit messages from terminal

Readme

CommitCraft CLI

Generate AI-powered commit messages from your terminal.

Installation

npm install -g commitcraft-cli

Or use with npx:

npx commitcraft-cli

Quick Start

  1. Stage your changes:
git add .
  1. Generate commit message:
commitcraft
  1. Select from 3 AI-generated options:
? Select a commit message:
❯ 1. feat(auth): add OAuth2 login support
  2. feat(auth): implement authentication flow
  3. feat: add social login feature
  Cancel
  1. The selected message is copied to your clipboard!

Usage

Generate commit message (default command)

commitcraft
# or
commitcraft generate

Auto-commit with selected message

commitcraft --commit
# or
commitcraft -c

Specify provider and options

commitcraft -p openai -m gpt-4 -l english
commitcraft -p groq
commitcraft -p ollama -m llama3.2

Configure API keys

commitcraft config

Options

| Option | Alias | Description | |--------|-------|-------------| | --provider | -p | AI provider: openai, groq, gemini, ollama | | --model | -m | Specific model to use | | --language | -l | Language: english or korean | | --commit | -c | Auto-commit with selected message | | --issue-pattern | | Regex to extract issue from branch | | --issue-prefix | | Prefix for issue (e.g., #) |

Configuration

Environment Variables

export OPENAI_API_KEY="sk-..."
export GROQ_API_KEY="gsk_..."
export GEMINI_API_KEY="AI..."
export OLLAMA_URL="http://localhost:11434"

Config File (~/.commitcraftrc)

{
  "provider": "openai",
  "model": "gpt-4o-mini",
  "language": "english",
  "openaiApiKey": "sk-...",
  "groqApiKey": "gsk_...",
  "geminiApiKey": "AI..."
}

.env File

You can also use a .env file in your project or home directory:

OPENAI_API_KEY=sk-...
GROQ_API_KEY=gsk_...
COMMITCRAFT_PROVIDER=openai
COMMITCRAFT_LANGUAGE=english

Git Hook Integration

Auto-generate commit messages on every git commit:

Install hook

commitcraft hook install

Uninstall hook

commitcraft hook uninstall

Check status

commitcraft hook status

How it works

Once installed, CommitCraft will automatically generate a commit message when you run git commit. The hook:

  1. Detects staged changes
  2. Calls the AI provider to generate a message
  3. Pre-fills the commit message editor

You can still edit the message before confirming.

Skip auto-generation

The hook automatically skips when:

  • You provide a message with -m flag
  • It's a merge, squash, or amend commit
  • There's already a commit message

Debug mode

To see hook logs, set the environment variable:

export COMMITCRAFT_HOOK_DEBUG=1

Issue Linking

Extract issue numbers from branch names:

# Branch: feature/123-add-login
commitcraft --issue-pattern "feature/(\d+)" --issue-prefix "#"
# Result: feat(auth): add login validation #123
# Branch: JIRA-456-fix-bug
commitcraft --issue-pattern "(JIRA-\d+)"
# Result: fix(api): resolve null pointer JIRA-456

Providers

OpenAI (default)

  • Default model: gpt-4o-mini
  • Requires: OPENAI_API_KEY
  • Get key: https://platform.openai.com/api-keys

Groq

  • Default model: llama-3.1-8b-instant
  • Requires: GROQ_API_KEY
  • Get key: https://console.groq.com/keys
  • Fast and free tier available

Gemini

  • Default model: gemini-1.5-flash
  • Requires: GEMINI_API_KEY
  • Get key: https://aistudio.google.com/app/apikey

Ollama (Local/Offline)

  • Default model: llama3.2
  • No API key required
  • Install: https://ollama.ai/
  • Run: ollama pull llama3.2

Examples

Basic usage

$ git add src/auth.ts
$ commitcraft

✓ Got staged changes
✓ Generated commit messages

? Select a commit message:
❯ 1. feat(auth): add password validation
  2. feat(auth): implement input validation for login
  3. feat: add authentication validation
  Cancel

✓ Copied to clipboard: feat(auth): add password validation

Auto-commit

$ commitcraft --commit

✓ Got staged changes
✓ Generated commit messages

? Select a commit message: 1. feat(auth): add password validation
✓ Committed: feat(auth): add password validation

Korean language

$ commitcraft -l korean

✓ Got staged changes
✓ Generated commit messages

? Select a commit message:
❯ 1. feat(auth): 비밀번호 유효성 검사 추가
  2. feat(auth): 로그인 입력값 검증 구현
  3. feat: 인증 유효성 검사 추가
  Cancel

Supported Commit Types

| Type | Description | |------|-------------| | feat | New feature | | fix | Bug fix | | docs | Documentation | | style | Formatting | | refactor | Code refactoring | | perf | Performance | | test | Tests | | build | Build system | | ci | CI/CD | | chore | Maintenance |

License

MIT