@neelfrostrain/commit-ai
v1.3.2
Published
AI-assisted commit message generator and auto-committer
Maintainers
Readme
Commit-AI 🤖
Professionalize your Git history with AI-generated Conventional Commits.
Stop writing "fixed stuff" and start writing commits that tell a story.
📖 About Commit-AI
Commit-AI was born out of a common developer frustration: the "Lazy Commit" syndrome. We've all written messages like fixed bug, update index.ts, or the dreaded ...........
This tool transforms raw, technical code changes into human-readable, professional documentation. By leveraging the Llama 3.1 8B model via Groq's ultra-fast inference engine, Commit-AI acts as a bridge between your terminal and your project's history.
🧠 The Logic
The tool doesn't just look at filenames; it reads the Git Diff. It understands:
- Intent: Are you adding a feature or fixing a regression?
- Impact: What specific logic changed within the functions?
- Context: It filters out noise like
package-lock.jsonornode_modulesto focus on your actual contributions.
🏗️ Built With
- Bun: High-performance runtime and bundler.
- Groq SDK: Lightning-fast AI inference.
- Commander.js: CLI interface and flag management.
- Simple-Git: Local Git interaction layer.
- Chalk: Beautiful, colored terminal logs.
⚡ Quick Start
1️⃣ Installation
Install the tool globally using npm:
npm i @neelfrostrain/commit-ai -g
2️⃣ Get your API Key
- Visit Groq Cloud Console.
- Create a new API Key and copy it.
3️⃣ Configure Environment (Windows)
To use Commit-AI, you must set your GROQ_API_KEY as an environment variable. Choose your preferred terminal below:
Option A: Command Prompt (CMD)
Run this command (replace your_key_here with your actual key):
setx GROQ_API_KEY "your_key_here"
Option B: PowerShell
Run this command:
[System.Environment]::SetEnvironmentVariable('GROQ_API_KEY', 'your_key_here', 'User')
⚠️ Important: You must restart your terminal (CMD, PowerShell, or VS Code) after running these commands for the changes to take effect.
✨ Features
| Feature | Description |
| ------------------------- | ---------------------------------------------------------------- |
| 🧠 Deep Diff Analysis | Understands code logic, not just file metadata. |
| 📝 Conventional Style | Strictly follows the type: description standard. |
| 📊 Technical Reports | Generates a detailed bulleted summary for the commit body. |
| 🛡️ Smart Filtering | Respects .gitignore and ignores heavy lockfiles automatically. |
| 🚀 Sub-second Speed | Powered by Groq for nearly instant commit generation. |
📖 Usage
Command Flags
| Flag | Short | Description |
| ----------- | ----- | ------------------------------------------------------- |
| --commit | -c | Performs the git commit after generating the message. |
| --yes | -y | Skips the confirmation prompt (Auto-pilot). |
| --version | -v | Displays the current version. |
| --help | -h | Displays the help menu. |
Example Workflow
- Stage your changes:
git add .
- Run Commit-AI:
commit-ai -c
- Review & Confirm: The AI will show you a report and the suggested message. Type
yto finalize!
⚙️ Standards & Security
Conventional Commit Types
Commit-AI automatically categorizes your work into:
feat: New featuresfix: Bug fixesdocs: Documentation updatesstyle: Formatting/Lintingrefactor: Code restructuringchore: Build tasks/dependencies
🛡️ Privacy
- Local Keys: Your API key stays on your machine and is never shared.
- Diffs Only: Only the
git diffof your staged files is sent to the AI for processing. No other system data is accessed.
📄 License
MIT © Neel Frostrain
