gitwhisper 0.0.2
gitwhisper: ^0.0.2 copied to clipboard
AI-powered Git commit message generator that whispers the perfect commit message for your changes
gitwhisper #
Generated by the Very Good CLI π€
Git Whisper is an AI-powered Git commit message generator that whispers the perfect commit message based on your staged changes.
Getting Started π #
If the CLI application is available on pub, activate globally via:
dart pub global activate gitwhisper
Or locally via:
dart pub global activate --source=path <path to this package>
Features #
- π€ Leverages various AI models to analyze your code changes and generate meaningful commit messages
- π Follows conventional commit format:
<type>(<scope>): <description> - π Pre-fills the Git commit editor for easy review and modification
- π Securely saves API keys for future use
- π Supports multiple AI models:
- Claude (Anthropic)
- OpenAI (GPT)
- Gemini (Google)
- Grok (xAI)
- Llama (Meta)
Usage #
# List available models
gitwhisper --list-models
# Use with a specific model and API key
gitwhisper --model openai --key "your-api-key"
# Save an API key for future use
gitwhisper --model claude --key "your-claude-key" --save-key
# Use a previously saved API key
gitwhisper --model claude
# Get help
gitwhisper --help
API Keys #
You can provide API keys in several ways:
- Command line argument:
--key "your-api-key" - Environment variables:
ANTHROPIC_API_KEY(for Claude)OPENAI_API_KEY(for OpenAI)GEMINI_API_KEY(for Gemini)GROK_API_KEY(for Grok)LLAMA_API_KEY(for Llama)
- Saved configuration: Use
--save-keyto store your API key in~/.git_whisper.yaml
How It Works #
Git Whisper:
- Checks if you have staged changes in your repository
- Retrieves the diff of your staged changes
- Sends the diff to the selected AI model
- Generates a commit message following the conventional commit format
- Pre-fills the git commit editor with the generated message
- Opens the editor for your review and confirmation
Configuration #
Configuration is stored in ~/.git_whisper.yaml and typically contains your saved API keys:
api_keys:
claude: "your-claude-key"
openai: "your-openai-key"
# ...
Requirements #
- Dart SDK (>=2.19.0 <3.0.0)
- Git installed and available in your PATH
Conventional Commit Format #
Git Whisper generates commit messages following the conventional commit format:
<type>(<scope>): <description>
Common types include:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code changes that neither fix bugs nor add featurestest: Adding or fixing testschore: Changes to the build process or auxiliary tools
Contributing #
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License #
This project is licensed under the MIT License - see the LICENSE file for details.