gitwhisper 0.1.10 copy "gitwhisper: ^0.1.10" to clipboard
gitwhisper: ^0.1.10 copied to clipboard

AI-powered Git commit message generator that whispers the perfect commit message for your changes

gitwhisper

coverage style: very good analysis License: MIT

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.


Be nice and buy me a coffee alright or matcha ๐Ÿคฃ


Editor Integrations ๐Ÿ”Œ #

GitWhisper is also available as plugins for popular editors:

Visual Studio Code #

Install the GitWhisper extension directly from the marketplace:

  • Extension: GitWhisper for VS Code
  • Developer: Panashe Mushinyi
  • Features: Generate commit messages directly within VS Code's Git interface

JetBrains IDEs #

Available for all JetBrains IDEs (IntelliJ IDEA, WebStorm, PhpStorm, etc.):

Getting Started ๐Ÿš€ #

If you have Dart installed, activate globally via:

dart pub global activate gitwhisper

Or locally via:

dart pub global activate --source=path <path to this package>

Or on Mac using Homebrew:

brew tap iamngoni/homebrew-gitwhisper
brew install gitwhisper

Or on Debian using APT:

echo "deb [trusted=yes] https://iamngoni.github.io/gitwhisper-apt stable main" | sudo tee /etc/apt/sources.list.d/gitwhisper.list
sudo apt update
sudo apt install gitwhisper

Or directly with curl:

curl -sSL https://raw.githubusercontent.com/iamngoni/gitwhisper/master/install.sh | bash

Or on the beloved Windows using Powershell (as Administrator):

irm https://raw.githubusercontent.com/iamngoni/gitwhisper/master/install.ps1 | iex

Or download the executable binary for your operating system directly here.

Features #

  • ๐Ÿค– Leverages various AI models to analyze your code changes and generate meaningful commit messages
  • ๐Ÿ”„ Follows conventional commit format with emojis: <emoji> <type>: <description>
  • โœจ Interactive commit confirmation - Review, edit, retry with different models, or discard generated messages
  • ๐Ÿ“‹ Pre-fills the Git commit editor for easy review and modification
  • ๐Ÿš€๏ธ Supports automatic pushing of commits to the remote repository
  • ๐Ÿ” Code analysis to understand staged changes and get suggestions for improvements
  • ๐ŸŽซ Supports ticket number prefixing for commit messages
  • ๐Ÿงฉ Choose specific model variants (gpt-4o, claude-3-opus, etc.)
  • ๐Ÿ”‘ Securely saves API keys for future use
  • ๐ŸŒ Multi-language support for commit messages and analysis
  • ๐Ÿ”Œ Supports multiple AI models:
    • Claude (Anthropic)
    • OpenAI (GPT)
    • Gemini (Google)
    • Grok (xAI)
    • Llama (Meta)
    • Deepseek (DeepSeek, Inc.)
    • GitHub Models (Free, rate-limited)
    • All Ollama models

Usage #

# Generate a commit message (main command)
gitwhisper commit --model openai
gitwhisper # shorthand for 'gitwhisper commit' - runs commit command by default
gw # even shorter command - also runs 'gitwhisper commit' by default

# Choose a specific model variant
gitwhisper commit --model openai --model-variant gpt-4o
gw commit --model openai --model-variant gpt-4o

# Add a ticket number prefix to your commit message
gitwhisper commit --prefix "JIRA-123"
gw commit --prefix "JIRA-123"

# Automatically push the commit to the remote repository
gitwhisper commit --auto-push
gw commit --auto-push
gw commit -a # shorthand for --auto-push

# Analyze your changes (staged/unstaged) with AI
gitwhisper analyze
gw analyze

# List available models
gitwhisper list-models
gw list-models

# List available variants for a specific model
gitwhisper list-variants --model claude
gw list-variants --model claude

# Change the language for commit messages and analysis
gitwhisper change-language
gw change-language

# Save an API key for future use
gitwhisper save-key --model claude --key "your-claude-key"
gw save-key --model claude --key "your-claude-key"

# Set defaults (model is required, model-variant is optional)
gitwhisper set-defaults --model openai --model-variant gpt-4o
gw set-defaults --model openai --model-variant gpt-4o

# Set just the default model (without variant)
gitwhisper set-defaults --model claude
gw set-defaults --model claude

# Set defaults for Ollama with custom base URL
gitwhisper set-defaults --model ollama --model-variant llama3 --base-url http://localhost:11434
gw set-defaults --model ollama --model-variant llama3 --base-url http://localhost:11434

# Show current defaults
gitwhisper show-defaults
gw show-defaults

# Clear defaults
gitwhisper clear-defaults
gw clear-defaults

# Always stage changes first
gitwhisper always-add true
gw always-add true

# Get help
gitwhisper --help
gw --help

Shorter Command #

Instead of using the full gitwhisper command you can also use the shortened one gw. Both gitwhisper and gw without any subcommands will automatically run the commit command by default.

Interactive Commit Confirmation #

GitWhisper now features an interactive commit confirmation workflow that gives you full control over your commit messages:

What You Can Do: #

  • Apply: Use the generated commit message as-is
  • Edit: Modify the commit message before applying
  • Retry: Generate a new message with the same model
  • Try Different Model: Generate with a different AI model
  • Discard: Cancel and exit without committing

Example Workflow: #

$ gitwhisper commit
๐Ÿ”ฎ Analyzing your changes...
โœจ Generated commit message: feat: โœจ Add user authentication system

Options:
[A] Apply commit message
[E] Edit commit message
[R] Retry with same model
[M] Try different model
[D] Discard and exit

What would you like to do? (A/e/r/m/d): 

Command Structure #

GitWhisper uses a command-based structure:

  • commit: Generate and apply a commit message with interactive confirmation (main command)
  • analyze: Examine changes (staged/unstaged) and provide detailed code analysis with suggestions for improvements
  • list-models: Show all supported AI models
  • list-variants: Show available variants for each AI model
  • change-language: Set the language for AI-generated commit messages and analysis
  • save-key: Store an API key for future use
  • update: Update GitWhisper to the latest version
  • set-defaults: Set default model and variant for future use (supports --base-url for Ollama)
  • show-defaults: Display current default settings
  • clear-defaults: Clear any set default preferences

API Keys #

You can provide API keys in several ways:

  1. Command line argument: --key "your-api-key"
  2. 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)
  3. Saved configuration: Use the save-key command to store your API key permanently

Model Variants #

GitWhisper supports a comprehensive range of model variants:

OpenAI #

  • gpt-4 (default)
  • gpt-4-turbo-2024-04-09
  • gpt-4o
  • gpt-4o-mini
  • gpt-4.5-preview
  • gpt-3.5-turbo-0125
  • gpt-3.5-turbo-instruct
  • o1-preview
  • o1-mini
  • o3-mini

Claude (Anthropic) #

  • claude-3-opus-20240307 (default)
  • claude-3-sonnet-20240307
  • claude-3-haiku-20240307
  • claude-3-5-sonnet-20240620
  • claude-3-5-sonnet-20241022
  • claude-3-7-sonnet-20250219

Gemini (Google) #

  • gemini-2.5-pro-preview-05-06 (advanced reasoning, 1M token context)
  • gemini-2.5-flash-preview-04-17 (adaptive thinking, cost efficient)
  • gemini-2.0-flash (default, fast performance)
  • gemini-2.0-flash-lite (lowest latency)
  • gemini-1.5-pro-002 (supports up to 2M tokens)
  • gemini-1.5-flash-002 (supports up to 1M tokens)
  • gemini-1.5-flash-8b (most cost effective)

Grok (xAI) #

  • grok-1 (default)
  • grok-2
  • grok-3
  • grok-2-mini

Llama (Meta) #

  • llama-3-70b-instruct (default)
  • llama-3-8b-instruct
  • llama-3.1-8b-instruct
  • llama-3.1-70b-instruct
  • llama-3.1-405b-instruct
  • llama-3.2-1b-instruct
  • llama-3.2-3b-instruct
  • llama-3.3-70b-instruct

Deekseek (DeepSeek, Inc.) #

  • deekseek-chat (default)
  • deepseek-reasoner

GitHub (Free to use models) - rate limited #

To run GitHub models you may need the following:

To authenticate with the model you will need to generate a personal access token (PAT) in your GitHub settings. Create your PAT token by following instructions here: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens

Ollama (self-hosted) #

How It Works #

Git Whisper:

  1. Checks if you have staged changes in your repository
  2. Retrieves the diff of your staged changes
  3. Sends the diff to the selected AI model
  4. Generates a commit message following the conventional commit format with emojis
  5. Shows you an interactive confirmation - review, edit, retry, or discard the message
  6. Applies any prefix/ticket number if specified
  7. Submits the commit with the confirmed message

Language Support #

GitWhisper supports generating commit messages and analysis in multiple languages:

  • English (default)
  • Spanish
  • French
  • German
  • Chinese (Simplified & Traditional)
  • Japanese
  • Korean
  • Arabic
  • Italian
  • Portuguese
  • Russian
  • Dutch
  • Swedish
  • Norwegian
  • Danish
  • Finnish
  • Greek
  • Turkish
  • Hindi
  • Shona
  • Zulu

Language Behavior #

When using non-English languages:

  • Commit messages: The commit type (e.g., feat:, fix:) and emoji remain in English for tool compatibility, while the description is generated in your selected language
  • Analysis: The entire analysis response is provided in your selected language

Example commit message in Spanish:

feat: โœจ Agregar funcionalidad de modo oscuro

Use the change-language command to set your preferred language:

gitwhisper change-language
gw change-language

Configuration #

Configuration is stored in ~/.git_whisper.yaml and typically contains your saved API keys and language preference:

api_keys:
  claude: "your-claude-key"
  openai: "your-openai-key"
  # ...
whisper_language: english

Requirements #

  • Dart SDK (^3.5.0)
  • Git installed and available in your PATH

Conventional Commit Format #

Git Whisper generates commit messages following the conventional commit format with emojis: fix: ๐Ÿ› Fix login validation

With Prefix #

If a prefix (e.g., a ticket number or task ID) is provided, Git Whisper intelligently formats it based on the number of commit messages:

  • For a single commit message, the prefix appears after the emoji:

fix: ๐Ÿ› PREFIX-123 -> Fix login validation

  • For multiple unrelated commit messages, the prefix appears in bold at the top, and each message starts with an arrow after the emoji:
PREFIX-123
feat: โœจ Add dark mode toggle
fix: ๐Ÿ› Resolve token refresh bug

This ensures your commits are always clean, readable, and traceable.

Common Commit Types and Emojis #

Type Emoji Description
feat โœจ New feature
fix ๐Ÿ› Bug fix
docs ๐Ÿ“š Documentation changes
style ๐Ÿ’„ Code style changes (formatting, whitespace, etc.)
refactor โ™ป๏ธ Code refactoring (no new features or fixes)
test ๐Ÿงช Adding or updating tests
chore ๐Ÿ”ง Build process or auxiliary tool changes
perf โšก Performance improvements
ci ๐Ÿ‘ท Continuous Integration/Deployment changes
build ๐Ÿ“ฆ Build system or dependency changes
revert โช Revert a previous commit

Contributing #

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License #

This project is licensed under the MIT License - see the LICENSE file for details.


5
likes
130
points
580
downloads

Publisher

verified publisheriamngoni.co.zw

Weekly Downloads

AI-powered Git commit message generator that whispers the perfect commit message for your changes

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (license)

Dependencies

args, cli_completion, dio, mason_logger, path, pub_updater, universal_io, yaml

More

Packages that depend on gitwhisper