Skip to content

iamngoni/gitwhisper

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/Ubuntu using APT (supports amd64 and arm64):

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 that will work on your operating system directly here.

Features

  • 🤖 Leverages various AI models to analyze your code changes and generate meaningful commit messages
  • 🔄 Follows conventional commit format: <type>: <description> or <type>: <emoji> <description> when emojis are enabled
  • 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
  • 🏷️ Create git tags alongside commits with optional auto-push
  • 🧩 Choose specific model variants (gpt-4o, claude-sonnet-4, etc.)
  • 🔑 Securely saves API keys for future use
  • 🌍 Multi-language support for commit messages and analysis
  • 🧠 Agent mode is used by default for providers that support tools
  • 🛠️ Local ACP agents can inspect staged changes through GitWhisper's read-only MCP tools
  • 🔌 Supports multiple AI models:
    • Claude (Anthropic)
    • Claude Code ACP agent
    • Codex ACP agent
    • OpenAI (GPT)
    • Gemini (Google)
    • Grok (xAI)
    • Llama (Meta)
    • Deepseek (DeepSeek, Inc.)
    • GitHub Models
    • 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

# Tool-capable models use agent mode by default
gitwhisper commit --model openai
gitwhisper commit --model claude
gitwhisper commit --model gemini
gitwhisper commit --model grok
gitwhisper commit --model llama
gitwhisper commit --model deepseek
gitwhisper commit --model github
gitwhisper commit --model ollama

# 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

# Create a git tag for this commit
gitwhisper commit --tag v1.0.0
gw commit -t v1.0.0

# Combine tag with auto-push to push both commit and tag
gw commit -t v1.0.0 -a

# Use local ACP agent providers (no GitWhisper API key required)
gitwhisper commit --model codex
gitwhisper commit --model claude-code
gitwhisper commit --model qoder
gitwhisper commit --model poolside

# 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

# Work with ACP agents from the registry
gitwhisper acp list
gw acp list
gw acp info vtcode
gw acp resolve codex
gw acp install vtcode
gw acp cache path
gw acp cache refresh

# 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

# Set max diff size (characters) before prompting for interactive staging
gw set-defaults --max-diff-size 100000

# 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
  • acp: Inspect, resolve, install, and cache ACP registry agents
  • 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
  • show-config: Display the current config file path and contents
  • clear-defaults: Clear any set default preferences
  • always-add: Configure whether GitWhisper stages changes before committing

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

Local ACP agent providers do not need GitWhisper API keys:

  • codex resolves codex-acp from the ACP registry, launches its registry distribution, and lets that local agent inspect staged changes.
  • claude-code resolves claude-acp from the ACP registry, launches its registry distribution, and lets that local agent inspect staged changes.
  • Other supported ACP agent ids can be used directly, for example qoder, poolside, cline, or other agents shown by gw acp list.

GitWhisper caches the ACP registry under ~/.gitwhisper/acp/registry.json. If the registry cannot be fetched, GitWhisper uses the cached copy. If there is no cache yet, it prints a clear registry/cache error with a link to file a support issue. Binary-only ACP agents are installed under ~/.gitwhisper/acp/agents/ when you run gw acp install <agent> or when GitWhisper needs to launch them. Unsupported or generic registry entries are hidden from the default commit-agent list. Use gw acp list --all to see every registry entry, including agents that GitWhisper does not target for commit generation.

Agent mode is enabled by default for tool-capable providers:

  • gw commit --model openai
  • gw commit --model claude
  • gw commit --model gemini
  • gw commit --model grok
  • gw commit --model llama
  • gw commit --model deepseek
  • gw commit --model github
  • gw commit --model ollama
  • gw commit --model codex
  • gw commit --model claude-code
  • gw commit --model <supported-acp-agent-id>

In agent mode, GitWhisper gives the model read-only tools for staged files, diff stats, per-file diffs, diff hunks, file-content chunks, file search, related files, summaries, and blame. Local ACP agents receive these through GitWhisper's MCP server. The full diff is not sent in one prompt. Models without tool support automatically use the regular direct-diff mode.

Model Variants

GitWhisper supports a comprehensive range of model variants:

OpenAI

  • gpt-4o (default)
  • gpt-5
  • gpt-5-mini
  • gpt-5-nano
  • gpt-5-pro
  • gpt-4.1
  • gpt-4.1-mini
  • gpt-4.1-nano
  • gpt-4.5-preview
  • gpt-4o-mini
  • gpt-realtime
  • gpt-realtime-mini
  • o1-preview
  • o1-mini
  • o3-mini

Claude (Anthropic)

  • claude-sonnet-4-20250514 (default)
  • claude-sonnet-4-5-20250929
  • claude-opus-4-1-20250805
  • claude-opus-4-20250514
  • claude-3-7-sonnet-20250219
  • claude-3-7-sonnet-latest
  • claude-3-5-sonnet-latest
  • claude-3-5-sonnet-20241022
  • claude-3-5-sonnet-20240620
  • claude-3-opus-20240307
  • claude-3-sonnet-20240307
  • claude-3-haiku-20240307

Local ACP Agent Providers

  • codex uses the Codex ACP agent default model. Configure model selection in the local ACP agent.
  • claude-code uses the Claude ACP agent default model. Configure model selection in the local ACP agent.
  • Supported ACP agent ids from gw acp list use that agent's own model/configuration.

Gemini (Google)

  • gemini-2.0-flash (default, fast performance)
  • gemini-2.5-pro (advanced reasoning with thinking)
  • gemini-2.5-flash (updated Sep 2025)
  • gemini-2.5-flash-lite (most cost-efficient)
  • gemini-2.5-flash-image (image generation)
  • gemini-2.5-computer-use (agent interaction)
  • gemini-1.5-pro-002 (2M tokens)
  • gemini-1.5-flash-002 (1M tokens)
  • gemini-1.5-flash-8b (cost effective)

Grok (xAI)

  • grok-2-latest (default)
  • grok-4 (most intelligent)
  • grok-4-heavy (most powerful)
  • grok-4-fast (efficient reasoning)
  • grok-code-fast-1 (agentic coding)
  • grok-3 (reasoning capabilities)
  • grok-3-mini (faster responses)

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

Deepseek (DeepSeek, Inc.)

  • deepseek-chat (default)
  • deepseek-v3.2-exp (latest experimental)
  • deepseek-v3.1 (hybrid reasoning)
  • deepseek-v3.1-terminus
  • deepseek-r1-0528 (upgraded reasoning)
  • deepseek-v3-0324 (improved post-training)
  • deepseek-reasoner

GitHub Models

  • gpt-4o (default)
  • DeepSeek-R1
  • Llama-3.3-70B-Instruct
  • Deepseek-V3
  • Phi-4-mini-instruct
  • Codestral 25.01
  • Mistral Large 24.11
  • More models are available in the GitHub Models marketplace

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. Chooses agent mode for tool-capable providers, or direct-diff mode for providers without tool support
  3. In agent mode, exposes read-only staged-change tools instead of sending the whole diff at once
  4. In direct-diff mode, retrieves the diff and sends it to the selected AI model
  5. Generates a commit message following the configured conventional commit format
  6. Shows you an interactive confirmation when confirmation is enabled - review, edit, retry, or discard the message
  7. Applies any prefix/ticket number if specified
  8. 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:) remains in English for tool compatibility. If emojis are enabled, the emoji also remains standard, 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
max_diff_size: 50000  # Max diff size before prompting for interactive staging

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:

fix: Fix login validation

When emojis are enabled, the emoji is placed after the type:

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 is added before the description:
fix: PREFIX-123 -> Fix login validation

With emojis enabled:

fix: 🐛 PREFIX-123 -> Fix login validation
  • For multiple unrelated commit messages, the prefix appears at the top, and each message remains a valid conventional commit:
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.


About

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

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors

Languages