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

commitwise

v1.0.6

Published

AI-powered Git commit message generator using OpenAI GPT

Readme

🧠 CommitWise

AI-powered Git commit message generator with intelligent code scanning

npm version License: ISC

CommitWise leverages OpenAI's GPT models to automatically generate meaningful, Conventional Commits formatted commit messages while optionally scanning your code for potential issues, bugs, and security vulnerabilities.


📑 Table of Contents


✨ Features

  • 🤖 AI-Powered Commit Messages - Automatically generates meaningful commit messages using OpenAI GPT
  • 🔍 Intelligent Code Scanning - Detects runtime errors, bugs, and security issues in your changes
  • Conventional Commits Format - Follows industry-standard commit message conventions
  • 🎯 Interactive Workflow - Review, edit, or regenerate suggested messages
  • Multiple Commands - Choose between auto-commit, scan-only, or suggest-only modes
  • 🎨 Frontend-Aware - Special checks for frontend code quality
  • 🔒 Secure - Keeps your API key safe with environment variables or local config

🚀 Installation

Install CommitWise globally via npm:

npm install -g commitwise

⚙️ Setup

Option 1: Environment Variable (Recommended)

Set your OpenAI API key as an environment variable:

For Zsh (macOS default):

echo 'export OPENAI_API_KEY="sk-your-api-key-here"' >> ~/.zshrc
source ~/.zshrc

For Bash:

echo 'export OPENAI_API_KEY="sk-your-api-key-here"' >> ~/.bashrc
source ~/.bashrc

Option 2: Configuration File

Create a ~/.commitwiserc.json file in your home directory:

{
    "openaiApiKey": "sk-your-api-key-here"
}

💡 Tip: You can also place .commitwiserc.json in your project root to override global settings.


📖 Usage

commitwise auto - Interactive Commit Workflow

The complete workflow: scan your changes (if enabled), generate a commit message, and commit interactively.

# Stage your changes
git add .

# Run the interactive commit flow
commitwise auto

This command will:

  1. ✅ Run code quality checks on staged changes (if scanEnabled: true)
  2. 🤖 Generate an AI-powered commit message
  3. 💬 Let you accept, edit, or regenerate the message
  4. 📦 Commit your changes with the final message

commitwise scan - Code Analysis Only

Scan your staged changes for potential issues without generating a commit message.

# Stage your changes
git add .

# Scan for issues
commitwise scan

Perfect for:

  • Pre-commit quality checks
  • CI/CD pipeline integration
  • Quick code reviews

commitwise suggest - Message Generation Only

Generate a commit message without scanning or committing.

# Stage your changes
git add .

# Get a suggested commit message
commitwise suggest

Outputs a commit message like:

feat: add user authentication with JWT tokens

🔧 Configuration

CommitWise can be configured via .commitwiserc.json in your home directory (~) or project root.

Configuration Options

| Option | Type | Default | Description | | ------------------------ | --------- | ----------- | ------------------------------------------------- | | openaiApiKey | string | undefined | Your OpenAI API key (can also use env variable) | | model | string | gpt-4o | OpenAI model to use for generation | | maxCommitMessageLength | number | 72 | Maximum length of the commit message subject line | | scanEnabled | boolean | true | Enable/disable code scanning before committing |

Example Configuration

{
    "openaiApiKey": "sk-your-api-key-here",
    "model": "gpt-4o",
    "maxCommitMessageLength": 72,
    "scanEnabled": true
}

Available Models

You can use any OpenAI chat model:

  • gpt-4o-mini
  • gpt-4o (default)
  • gpt-4-turbo
  • gpt-4

🔍 How It Works

  1. 📊 Analyze Changes - Examines your staged changes using git diff --cached
  2. 🔬 Code Scanning - Optionally scans for:
    • Runtime errors and exceptions
    • Potential bugs and logic issues
    • Security vulnerabilities
    • Frontend-specific issues (console logs, debugging code, etc.)
  3. 🤖 AI Generation - Sends context to OpenAI GPT to generate a meaningful commit message
  4. 📝 Conventional Format - Formats messages following Conventional Commits:
    • feat: - New features
    • fix: - Bug fixes
    • docs: - Documentation changes
    • style: - Code style changes
    • refactor: - Code refactoring
    • test: - Test additions/changes
    • chore: - Maintenance tasks

Example Output

For adding a new feature:

feat: add user login with OAuth2 integration

For fixing a bug:

fix: handle null pointer in user profile update

For refactoring:

refactor: extract validation logic into separate module

🛠️ Troubleshooting

❌ "OPENAI API key not found"

Solution: Set the OPENAI_API_KEY environment variable or add it to your .commitwiserc.json file.

export OPENAI_API_KEY="sk-your-api-key-here"

❌ "No staged changes detected"

Solution: Stage your changes before running CommitWise:

git add .
# or stage specific files
git add path/to/file.ts

❌ API Rate Limits or Errors

Solution: Check your OpenAI account status and API key permissions at platform.openai.com.


💡 Getting Help


License

MIT © Purnima Madhubhashi


Made with ❤️ and 🤖 AI

⭐ Star on GitHub📦 View on npm