Automagically generate clear and concise commit messages using your preferred AI provider (Gemini or OpenAI) and Git. Perfect for keeping your Git history clean, organized, and magical! ✨
- ✨ AI-powered: Generate meaningful commit messages from your staged changes with Google Gemini (default) or OpenAI.
- ⚙️ Configurable workflow: Choose providers, print prompts locally, or add context before contacting an API.
- 📋 Consistent formatting: Optional Conventional Commits enforcement keeps history tidy and predictable.
- 💻 CLI tool: Simple command-line interface that fits into any Git workflow.
- 📝 Custom messages: Inject project-specific instructions directly into the prompt.
- 🗂 Exclude files: Skip changelog noise (lockfiles, docs, etc.) while the tool inspects your diff.
You can install Commit Wizard globally using npm:
npm install -g commit-wizardOr use it directly with npx without installation:
npx commit-wizardCommit Wizard talks to third-party LLMs. Set the environment variable that matches the provider you plan to use.
-
Create a key at the Google AI Studio.
-
Export it as
GEMINI_API_KEYin your shell:export GEMINI_API_KEY="your-gemini-api-key"
-
Create a key at the OpenAI platform.
-
Export it as
OPENAI_API_KEYin your shell:export OPENAI_API_KEY="your-openai-api-key"
Add the export line to your .bashrc, .zshrc, or shell profile if you want the variable set automatically for future sessions.
Once installed, you can use the tool in any git repository.
-
Stage your changes as usual:
git add . -
Run Commit Wizard (uses Gemini unless you select otherwise):
commit-wizard
Or, with
npx:npx commit-wizard
-
Confirm the commit message: After generating the commit message, you'll be asked to confirm if you want to proceed with the commit.
--dry-run, -d: Print the composed prompt without calling an AI provider.--message <text>, -m: Add extra context for the model (e.g. project goals or tricky areas).--exclude <files>, -e: Provide a comma-separated list of files to skip when building the diff.--conventional-commits, -c: Ask the model to format the title using the Conventional Commits spec.--provider <openai|gemini>, -p: Choose the AI backend. Defaults togemini.
Examples:
commit-wizard --dry-run --message "Focus on API breaking changes"
commit-wizard --provider openai --conventional-commits
commit-wizard --exclude "README.md"Check out how easy it is to use Commit Wizard:
We welcome contributions! To get started:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes.
- Submit a pull request!
Made with ❤️ by Ivan Gonzalez.
This project is licensed under the MIT License - see the LICENSE file for details.

