AI-powered conventional commit message generator for your Git workflow.
- 📑 Reads staged or unstaged Git changes
- 🤖 Uses OpenAI GPT models to craft concise conventional commit messages
- 💾 Configuration via
.gcommitrc
or environment variables - 🖥️ Cross-platform (Windows, macOS, Linux)
- ⚡ Optional
--auto
flag to commit with the generated message automatically
# Generate a commit message from your changes
npx gcommit
# Generate and commit in one shot
npx gcommit --auto
npm i -g gcommit-ai
First-time users will be prompted for an OpenAI API key:
gcommit config
or create a .gcommitrc
(in project root or home directory):
{
"openai_api_key": "sk-...",
"model": "gpt-4o-mini",
"language": "en",
"auto_commit": false
}
Environment variables are also supported:
OPENAI_API_KEY
GCOMMIT_MODEL
GCOMMIT_LANG
GCOMMIT_AUTO_COMMIT
gcommit # Generate a commit message
gcommit --auto # Generate and commit
gcommit config # Configure API key and preferences
gcommit --help # CLI help
gcommit --version # Version info
- Fork the repo and create a feature branch.
- Run
npm install
andnpm run build
. - Submit a pull request with a clear description.
- Multi-language support
- Support for other LLM providers (Anthropic, Mistral)
- Commit message templates/presets
- VS Code extension
MIT © 2025 Your Name
- OpenAI – language models
- Simple Git – Git integration