AI-powered git commit message generator. Stage your changes, run commitwiz, get perfect Conventional Commits β every time.
$ git add -A && commitwiz
π€ Analyzing diff... (3 files changed, +47 -12)
feat(auth): add JWT refresh token rotation
Implement automatic refresh token rotation on each access token
renewal. Expired refresh tokens are now invalidated server-side
to prevent replay attacks.
? [C]ommit [E]dit [R]egenerate [Q]uit: C
β
Committed!
- Consistent history β No more
fix stuff,wip, orasdf. Every commit follows Conventional Commits format. - Context-aware β Reads your actual diff, not just file names. Understands what changed and why.
- Fast β Uses
gpt-4o-miniby default. Most commits generate in under 2 seconds. - Works with local models β Ollama, LM Studio, or any OpenAI-compatible API. Your code never has to leave your machine.
- Interactive β Review before committing. Edit, regenerate, or bail out.
npm install -g commitwizOr run without installing:
npx commitwiz# 1. Set your API key (or use a local model β see below)
export OPENAI_API_KEY=sk-...
# 2. Stage changes
git add -A
# 3. Generate and commit
commitwiz# Interactive mode (default) β review, edit, regenerate, or quit
commitwiz
# Auto-commit without confirmation
commitwiz --auto
# Use a specific model
commitwiz --model gpt-4o
# Use a local model via Ollama
OPENAI_BASE_URL=http://localhost:11434/v1 commitwiz --model llama3| Feature | Details |
|---|---|
| π€ AI-powered | Uses OpenAI (or any compatible API) to analyze your staged diff |
| π Conventional Commits | Always generates properly formatted type(scope): description messages |
| β‘ Fast | gpt-4o-mini by default β sub-2-second generation |
| π Interactive | Commit, edit, regenerate, or quit β you're always in control |
| π Local models | Works with Ollama, LM Studio, or any OpenAI-compatible endpoint |
| π Private | Use local models and your code never leaves your machine |
export OPENAI_API_KEY=sk-...# Install Ollama and pull a model
ollama pull llama3
# Point commitwiz at Ollama
export OPENAI_BASE_URL=http://localhost:11434/v1
commitwiz --model llama3# Start LM Studio's local server, then:
export OPENAI_BASE_URL=http://localhost:1234/v1
export OPENAI_API_KEY=lm-studio
commitwizexport OPENAI_BASE_URL=https://your-api.example.com/v1
export OPENAI_API_KEY=your-key
commitwiz --model your-model# .git/hooks/prepare-commit-msg
#!/bin/sh
if [ -z "$2" ]; then
MSG=$(commitwiz --auto --stdout 2>/dev/null)
[ -n "$MSG" ] && echo "$MSG" > "$1"
fi# Install commitlint for validation
npm install -D @commitlint/cli @commitlint/config-conventional
# commitwiz generates β commitlint validates
commitwiz --auto && npx commitlint --edit# .github/workflows/commitlint.yml
name: Lint Commits
on: [pull_request]
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- run: npx commitlint --from ${{ github.event.pull_request.base.sha }}# Add to ~/.bashrc or ~/.zshrc
alias gc='git add -A && commitwiz'# Commit each package separately
for dir in packages/*/; do
cd "$dir"
git add -A
commitwiz --auto
cd ../..
done- Reads your staged diff via
git diff --cached - Sends the diff to your configured LLM with a system prompt enforcing Conventional Commits format
- Presents the message for review (or auto-commits with
--auto) - Commits using
git commit -m "..."on confirmation
The prompt ensures:
- Correct
type(scope): descriptionformat - Imperative mood ("add" not "added")
- Concise subject line (β€72 chars)
- Optional body for complex changes
| Tool | AI-Powered | Local Models | Interactive | Conventional Commits | Zero Config |
|---|---|---|---|---|---|
| commitwiz | β | β | β | β | β |
| aicommits | β | β | β | β | β |
| cz-cli | β | N/A | β | β | β |
| commitlint | β | N/A | β | β (validation only) | β |
| Manual | β | N/A | N/A | Sometimes | β |
- Solo developers β Stop agonizing over commit wording. Let AI draft, you approve.
- Teams β Enforce consistent Conventional Commits without training everyone on the spec.
- Open source β Clean commit history makes changelogs and releases trivial.
- Monorepos β Scope-aware messages help track which package changed.
- CI/CD β Conventional Commits enable automatic versioning with semantic-release.
env-lint-cliβ Validate .env files before deployingdep-sizeβ Check npm dependency sizes before installinglicense-makerβ Generate LICENSE files from the CLInpm-name-checkβ Check npm package name availabilitykill-port-cliβ Kill processes on any port
MIT