gitwhisper 1.0.1 copy "gitwhisper: ^1.0.1" to clipboard
gitwhisper: ^1.0.1 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, you can 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
  • ๐Ÿงช --dry-run to preview the generated message without creating a commit
  • ๐Ÿง  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, with live tool activity shown while they work
  • ๐Ÿ”Œ 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

# Preview the generated message without committing (no commit, push, or tag)
gitwhisper commit --dry-run
gw commit --dry-run

# 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 list --all        # include entries not used for commits
gw acp info qoder
gw acp resolve codex
gw acp install poolside
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. The cache is used first when it is fresh (refreshed at most every 6 hours), so commits stay off the network on the hot path; a stale or missing cache triggers a background fetch. If the registry cannot be fetched, GitWhisper falls back to the cached copy. If there is no cache yet, it prints a clear registry/cache error with a link to file a support issue. Run gw acp cache refresh to force an immediate network refresh. 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; entries GitWhisper does not target for commit generation are marked "not used for commits".

Which agents are supported. GitWhisper drives only first-party, product-backed coding agents โ€” ones that ship as a branded product with their own authentication and a managed model (Codex, Claude Code, Gemini CLI, Cursor, GitHub Copilot, and similar). Their commit output is predictable and supported. The supported set is whatever the live registry publishes minus the exclusions below, so it grows as the registry does; run gw acp list for the current list.

What is excluded, and why. The following registry ids are not targeted for commit generation because they are not product-backed coding agents:

  • Marketplaces / pay-per-call brokers: agoragentic-acp.
  • Agent frameworks or SDKs (build-your-own-agent, not a product): deepagents, fast-agent.
  • Generic, open-source, or bring-your-own-provider coding agents and ACP adapters, whose model and output quality vary by user setup: corust-agent, crow-cli, glm-acp-agent, goose, minion-code, opencode, pi-acp, sigit, vtcode.

This list lives in code (unsupportedCommitAgentIds) and may change over time; gw acp list --all is always the source of truth. If an agent you want is excluded, open an issue and we can evaluate adding it. While a local ACP agent works, GitWhisper shows its tool activity live (which files it reads, diffs, searches, and blames) instead of a silent wait. Failed or empty agent responses are logged under ~/.gitwhisper/acp/logs/ for debugging.

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.


5
likes
130
points
219
downloads

Documentation

API reference

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

License

MIT (license)

Dependencies

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

More

Packages that depend on gitwhisper