██████╗ ██████╗ ███╗ ███╗███╗ ███╗██╗████████╗ ██████╗ ███████╗███╗ ██╗██╗███████╗
██╔════╝██╔═══██╗████╗ ████║████╗ ████║██║╚══██╔══╝██╔════╝ ██╔════╝████╗ ██║██║██╔════╝
██║ ██║ ██║██╔████╔██║██╔████╔██║██║ ██║ ██║ ███╗█████╗ ██╔██╗ ██║██║█████╗
██║ ██║ ██║██║╚██╔╝██║██║╚██╔╝██║██║ ██║ ██║ ██║██╔══╝ ██║╚██╗██║██║██╔══╝
╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║ ██║ ╚██████╔╝███████╗██║ ╚████║██║███████╗
╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝╚═╝╚══════╝
AI-powered Git commit messages. One command. No config required.
Stop writing
"fix stuff". Stop writing"update". Stop writing"changes". CommitGenie reads your staged diff and generates the right commit message — in one second.
git add . → commitgenie → AI reads your diff → you review → committed
CommitGenie reads git diff --cached, sends it to your chosen AI provider, and returns a structured Conventional Commit message. It scans for secrets before committing, remembers your past messages, and works in any language your team needs.
npm install -g @ztv-main/commitgenieWorks immediately. No account. No API key. No config file.
git add .
commitgenie CommitGenie
Provider: free hosted
Suggested commit message
feat(auth): add JWT refresh token rotation
Implements automatic token rotation on refresh to improve security.
Tokens are now invalidated after single use.
[y] Commit with this message
[e] Edit message
[r] Regenerate
[h] Browse history (3 previous messages)
[x] Cancel
Use arrow keys to navigate, Enter to select. That's it.
|
Reads |
Automatically scans your staged diff for hardcoded secrets before every commit. Detects API keys, private keys, database URLs, passwords, tokens, and high-entropy strings. |
|
The last 10 generated messages are saved locally. Use |
Set |
|
|
|
| Provider | Cost | Setup | Best for |
|---|---|---|---|
| Free hosted (default) | Free — 20 req/day | None | Getting started |
| Groq | Free tier | console.groq.com | Unlimited, fast |
| OpenAI | Paid | platform.openai.com | GPT-4o quality |
| Anthropic | Paid | console.anthropic.com | Claude models |
| Ollama | Free | ollama.com | Fully offline |
To switch providers or set your own key:
commitgenie setupThe wizard tests your key before saving it. Keys are stored in ~/.commitgenie with 0600 permissions (owner-only).
Run this in any repo to create a shared team config:
commitgenie initThis creates .commitgenie.json — commit it so your whole team shares the same settings:
Ticket auto-linking — if your branch is feature/JIRA-1234-add-login, CommitGenie detects the ticket automatically:
feat(auth): add login page [JIRA-1234]
The scanner runs automatically when you select [y] Commit with this message. It can also be run standalone:
commitgenie scan CommitGenie scan
! 2 potential secret(s) detected:
1. OpenAI API Key — [HIGH]
File: src/config.js — line 4
Masked value: sk-123...5678
2. Database URL (with creds) — [HIGH]
File: src/db.js — line 12
Masked value: postgr...mydb
» Fix: Move secrets to .env files and add .env to .gitignore
Detects: OpenAI, Anthropic, Groq, AWS, GitHub, Stripe, Google, Slack, SendGrid, Twilio API keys · RSA and EC private keys · Database URLs with credentials · Hardcoded passwords · JWT tokens · Bearer tokens · High-entropy strings
All results are logged to ~/.commitgenie-scan-log.json for audit history.
commitgenie install # install hooks
commitgenie uninstall # remove hooksTwo hooks are installed into .git/hooks/:
| Hook | What it does |
|---|---|
pre-commit |
Scans staged files for secrets before every commit. Blocks if found. |
prepare-commit-msg |
Generates an AI commit message and pre-fills your editor. |
Workflow after install:
git add src/feature.ts
git commit
# → secrets scanned automatically
# → AI generates message silently
# → editor opens with message pre-filled
# → review, save, close → committedTo bypass for a single commit:
git commit --no-verifycommitgenie Generate a commit message for staged changes
commitgenie setup Configure AI provider and API key
commitgenie init Create .commitgenie.json for per-project settings
commitgenie install Install git hooks (secret scan + AI message)
commitgenie uninstall Remove git hooks
commitgenie pr Generate a PR description from commits ahead of main
commitgenie scan Scan staged changes for secrets
commitgenie help Show all commands
CommitGenie follows Conventional Commits:
<type>(<scope>): <short description>
[optional body]
| Type | When |
|---|---|
feat |
New feature |
fix |
Bug fix |
refactor |
Code restructured without behavior change |
docs |
Documentation only |
test |
Tests added or updated |
chore |
Build, config, dependencies |
perf |
Performance improvement |
Real examples:
feat(auth): add JWT refresh token rotation
fix(api): handle null response from payment gateway
refactor(dashboard): extract chart into separate component
docs(readme): update installation instructions
chore(deps): upgrade typescript to v5
perf(query): add index on user email column
| Concern | How it's handled |
|---|---|
| API key storage | ~/.commitgenie written with 0600 permissions (owner-only) |
| Shell injection | Commit messages passed via argument arrays, never interpolated into shell strings |
| Project config | All .commitgenie.json fields are type-checked and sanitised before use |
| Ollama SSRF | URL is validated to only allow localhost / 127.0.0.1 |
| Hosted backend | Real IP detection (x-real-ip), persistent rate limiting, input sanitisation, no internal errors exposed to callers |
| Your code | Sent only to your configured provider — never stored, never logged by CommitGenie |
- Node.js 16 or higher
- Git
Contributions are welcome. Please open an issue before submitting a pull request for significant changes.
MIT — © Souvik Ghosh
If CommitGenie saves you time, a star on GitHub goes a long way.
{ "ticketPrefix": "JIRA", // auto-appends ticket from branch name → [JIRA-1234] "bodyAlways": false, // always generate a commit body "language": "en", // commit message language (en, fr, de, ja, zh, ...) "defaultScope": "api", // override scope inference "customTypes": ["release"] // add custom commit types }