commit-wizard
v2.0.3
Published
Automagically generate commit messages using AI provider.
Downloads
39
Maintainers
Readme
🧙♂️ Commit Wizard
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! ✨

🚀 Features
- ✨ 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.
📦 Installation
You can install Commit Wizard globally using npm:
npm install -g commit-wizardOr use it directly with npx without installation:
npx commit-wizard🔑 API Key Setup
Commit Wizard talks to third-party LLMs. Set the environment variable that matches the provider you plan to use.
Default provider: Gemini
Create a key at the Google AI Studio.
Export it as
GEMINI_API_KEYin your shell:export GEMINI_API_KEY="your-gemini-api-key"
Alternate provider: OpenAI
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.
⚙️ Usage
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-wizardOr, with
npx:npx commit-wizardConfirm the commit message: After generating the commit message, you'll be asked to confirm if you want to proceed with the commit.

🛠️ Options
--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"📸 Demo
Check out how easy it is to use Commit Wizard:

🧑💻 Contributing
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!
👩🚀 Author
Made with ❤️ by Ivan Gonzalez.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
