@long260398/aicommit
v0.1.0
Published
Generate conventional commit messages from staged changes using Claude AI
Maintainers
Readme
ai-commit
Generate conventional commit messages from staged changes using AI — free with Groq, or higher quality with Claude.
Demo
$ git add src/auth.ts
$ ai-commit
ai-commit · AI-powered git commits
⠙ Generating commit message...
✔ Suggested commit message:
❯ feat(auth): add JWT token validation middleware
Press Enter to confirm, or type to edit (Ctrl+C to cancel):
>
✔ Committed: feat(auth): add JWT token validation middlewareFeatures
- Zero configuration — set your API key once, run
ai-commitanywhere - Always conventional — follows
feat/fix/docs/choreformat automatically - Edit before commit — review and change the message before it lands
- Dry run mode — preview without committing:
ai-commit --dry-run - Works with any stack — language and framework agnostic
Getting Started
Prerequisites
- Node.js 18+
- An API key — Groq is free, Claude is paid but higher quality
Install
npm install -g @long260398/aicommitOr try without installing:
npx @long260398/aicommit --dry-runSet your API key
Option 1 — Groq (free): console.groq.com
# Mac / Linux
export GROQ_API_KEY=gsk_your-key-here
# Windows PowerShell
$env:GROQ_API_KEY="gsk_your-key-here"Option 2 — Claude (higher quality): console.anthropic.com — ~$0.0001/commit
# Mac / Linux
export ANTHROPIC_API_KEY=sk-ant-your-key-here
# Windows PowerShell
$env:ANTHROPIC_API_KEY="sk-ant-your-key-here"The tool auto-detects which key is set. Set one and run.
Usage
Stage your changes, then run:
git add .
ai-commitPreview without committing:
ai-commit --dry-runCheck version:
ai-commit --versionStack
- Runtime: Node.js 18+
- Language: TypeScript
- AI: Groq (Llama 3.3, free) or Claude Haiku (paid)
- Format: Conventional Commits
Contributing
Pull requests are welcome. For major changes, open an issue first.
License
Support
If this saves you time on every commit, consider sponsoring on GitHub.
