aicommits
A CLI that writes your git commit messages for you with AI from your staged changes.
At a Glance
MIT-licensed CLI that writes git commit messages with AI. Free to use; users supply their own AI provider API key or run local models.
Engagement
Available On
Alternatives
Listed Oct 2026
About aicommits
aicommits is an open-source command-line tool, maintained by Hassan El Mghari (Nutlope) and contributors, that generates git commit messages with an AI model. It reads your staged changes and proposes a commit subject, with an optional description. Version 4.2.2 is published on npm and requires Node.js v22 or newer.
What It Is
aicommits is a Node.js CLI for developers who want AI to draft commit messages. After you stage files with git, running aicommits (or the aic alias) generates a message and commits it. Unknown flags are passed through to git commit. It can also be installed as a prepare-commit-msg git hook, so a normal git commit produces a generated message that opens in your configured editor for review.
How Message Generation Works
The model receives the staged file list, requests the staged diffs it needs, and submits a validated commit subject with an optional description. Only Git's staged snapshot is read, so unstaged edits are never sent to the model. Together AI, OpenAI, xAI and LM Studio use this agentic flow, falling back to a one-shot path when an endpoint rejects tools. Other providers use the one-shot flow.
Formats and Customization
Five formats are supported: plain, conventional, conventional+body, gitmoji and subject+body. Options include generating several candidates, copying the message to the clipboard, excluding files, setting the locale, setting a maximum subject length, and passing a custom prompt such as writing in another language. Settings can come from command-line arguments, environment variables, the .aicommits config file, or defaults, in that order of precedence.
Providers and Setup
Run aicommits setup to choose a provider, enter an API key, pick a model and set a default format. Supported providers are TogetherAI, OpenAI, Groq, xAI, OpenRouter, Ollama, LM Studio and any custom OpenAI-compatible endpoint. Ollama and LM Studio run models locally. aicommits model changes the model and aicommits update upgrades the tool using the detected package manager.
Community Discussions
Be the first to start a conversation about aicommits
Share your experience with aicommits, ask questions, or help others learn from your insights.
Pricing
Open Source
MIT-licensed CLI that writes git commit messages with AI. Free to use; users supply their own AI provider API key or run local models.
- MIT License
- CLI that writes git commit messages with AI
- Bring your own API key for providers such as TogetherAI, OpenAI, Groq, xAI, OpenRouter
- Local providers supported: Ollama and LM Studio (no API key required for LM Studio)
- Custom OpenAI-compatible endpoint support
Capabilities
Key Features
- Generates git commit messages from staged changes
- Five formats: plain, conventional, conventional+body, gitmoji, subject+body
- Generate multiple message options to choose from
- Optional commit description
- Custom prompts and locale setting
- Git prepare-commit-msg hook install/uninstall
- Exclude files from AI analysis
- Copy message to clipboard
- Interactive setup and model selection
- Self-update command
- Configuration via file or environment variables
- Only staged snapshot is sent to the model
