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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@alekschen/ai-commit

v1.2.1

Published

Generate Conventional Commit messages from git diff using OpenAI compatible APIs

Readme

AI Commit

English | 简体中文 | 日本語 | 한국어 | Español | العربية

A powerful CLI tool that generates Conventional Commits messages from your git changes using OpenAI-compatible APIs. Stop struggling with commit messages. Let AI write them for you—concise, standardized, and meaningful. 🔒 Absolutely Secure | 🛡️ Privacy First | 🆓 100% Free & Open Source

License Version Node

Features

  • 🔒 Privacy First: Your code is sent directly to your configured API provider. No intermediate servers, no tracking. 100% Open Source—audit it yourself. Configuration is stored locally.
  • 🤖 AI-Powered Generation: Analyzes your git diff to generate accurate and descriptive commit messages.
  • 📏 Conventional Commits: Follows the standard format (feat, fix, chore, etc.) out of the box.
  • 🎯 Multiple Options: Generates multiple commit message variations for you to choose from.
  • 🌍 Multi-Language Support: Fully localized in English, Chinese, Japanese, Korean, Spanish, and Arabic.
  • 🔧 Highly Configurable: Support for custom OpenAI-compatible APIs (DeepSeek, Azure, etc.), custom models, and prompts.
  • 📊 Cost Tracking: Built-in usage statistics to track your token consumption and costs.
  • 🚀 Interactive Mode: Review, edit, regenerate, or commit directly from the CLI.
  • 🧠 Smart Context: Automatically compresses large diffs to fit within token limits while preserving context.
  • 🎨 Fun ASCII Art: Customizable startup banner (Psyduck, Totoro, Cat, etc.).
  • 🪝 Git Hook Support: Can be used as a prepare-commit-msg hook or with other git tools.

Installation

Ensure you have Node.js (>= 18.0.0) installed.

# Install globally via npm
npm install -g @alekschen/ai-commit

Updating

This tool automatically checks for updates and will notify you if a new version is available. To update manually:

npm install -g @alekschen/ai-commit@latest

Quick Start

  1. Initialize Configuration Run the config command to set up your API key (OpenAI or compatible provider).

    ai-commit config

    How to Set

  2. Generate a Commit Stage your changes and run:

    git add .
    ai-commit

    Or simply run ai-commit and let it stage changes for you (if configured).

    How to Use

  3. Review & Commit The tool will generate options. You can:

    • Select: Choose your preferred message.
    • Edit: Modify the message in your default editor.
    • Regenerate: Ask AI to try again.

Usage

Basic Commands

# Generate commit message for staged changes
ai-commit

# Provide a hint to guide the generation
ai-commit "refactor authentication logic"

# Print the message to stdout without interactive menu (useful for scripts)
ai-commit --print

# Write message to a file (useful for git hooks like prepare-commit-msg)
ai-commit --write .git/COMMIT_EDITMSG

# Run in quiet mode (suppress banners/logs)
ai-commit --quiet

Configuration

Manage your settings via the interactive menu:

ai-commit config

You can configure:

  • API Provider: Base URL (default: https://api.openai.com/v1) and API Key.
  • Model: Choose any chat model (default: gpt-3.5-turbo).
  • Prompt Style: Choose from Default, Emoji, Simple, or Custom templates.
  • ASCII Art: Customize the startup banner.
  • Language: Switch UI language.

View Usage Statistics

Check your API usage, token count, and model performance:

ai-commit cost

Environment Variables

You can override configuration using environment variables, useful for CI/CD pipelines:

| Variable | Description | | ---------------------------- | ------------------------------------------------------ | | AI_COMMIT_API_KEY | Your API Key | | AI_COMMIT_BASE_URL | Custom API Base URL | | AI_COMMIT_MODEL | Model name (e.g., gpt-4, deepseek-chat) | | AI_COMMIT_MAX_CHARS | Max characters for diff context (default: 200000) | | AI_COMMIT_MAX_FILES | Max files to process (default: 50) | | AI_COMMIT_MAX_LINES | Max lines per file to include (default: 15) | | AI_COMMIT_INCLUDE_SNIPPETS | Set to 0 to disable code snippets in prompt | | AI_COMMIT_AUTO_STAGE | Set to 1 to auto-stage changes, 0 to fail if empty | | AI_COMMIT_SIGN | Set to 1 to sign commits (git commit -S) | | AI_COMMIT_AMEND | Set to 1 to amend commits (git commit --amend) |

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.