Skip to main content

AI generated commit messages.

Project description

gmuse Logo

gmuse

GitHub Read the Docs

Checks codecov

PyPI Python Versions

License: MIT

AI generated git commit messages in the shell using LLMs.

Highlights

  • AI-powered shell completions (zsh, experimental) — context-aware suggestions for git commit -m that help you generate commit messages faster.
  • Fast, configurable message generation — generate high‑quality commit messages via the CLI with customizable prompts, models, and provider settings.

Quickstart

  1. Install gmuse (see Installation below).
  2. Set credentials for your provider:
  • Interactive setup: gmuse auth set OPENAI_API_KEY
  • Non-interactive environments (CI, containers, automation): export environment variables (for example OPENAI_API_KEY)
  1. Load completions: eval "$(gmuse git-completions zsh)"
  2. Stage changes: git add .
  3. Test: git commit -m <TAB> — gmuse will suggest a message; confirm to use it.
  4. Alternatively, generate a commit message directly: gmuse msg
  5. Preview the prompt without calling LLM: gmuse msg --dry-run

See Completions docs for configuration and how to persist the completion across sessions.

Installation

# Basic installation
pip install gmuse

# With clipboard support
pip install gmuse[clipboard]

Provider Setup

gmuse supports 100+ LLM providers via LiteLLM.

Interactive setup (stores credentials in your OS keyring):

gmuse auth set OPENAI_API_KEY
gmuse auth status

Auth command details: https://gmuse.readthedocs.io/en/latest/reference/cli.html#gmuse-auth

Non-interactive environments (CI, containers, automation):

export OPENAI_API_KEY="sk-..."          # For OpenAI
export ANTHROPIC_API_KEY="sk-ant-..."  # For Anthropic
export GOOGLE_API_KEY="..."             # For Google
# Or configure in ~/.config/gmuse/config.toml

Provider selection is auto-detected from credentials (environment variables first, then keyring when env values are unset or blank).

Default model choices (cost-efficient variants):

  • openai: gpt-4o-mini
  • anthropic: claude-haiku-4-5
  • cohere: command-light
  • azure: gpt-4o-mini
  • gemini: gemini/gemini-flash-lite-latest

These defaults are chosen to prioritize lower cost and latency for short, high-throughput tasks like commit-message generation. You can override via GMUSE_MODEL env var or the --model CLI option.

Zsh completions (experimental)

Generate a Zsh completion script that provides AI-powered commit message suggestions for git commit -m.

Quick install:

# Add to your ~/.zshrc so the completion is loaded on shell startup
eval "$(gmuse git-completions zsh)"

Configuration:

  • GMUSE_COMPLETIONS_ENABLED (default true) — enable/disable completions
  • GMUSE_COMPLETIONS_TIMEOUT (default 3.0) — generation timeout in seconds
  • GMUSE_COMPLETIONS_CACHE_TTL (default 30) — cache TTL in seconds

See the documentation for details: https://gmuse.readthedocs.io/en/latest/how_to/completions.html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gmuse-0.3.0.tar.gz (3.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gmuse-0.3.0-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

Details for the file gmuse-0.3.0.tar.gz.

File metadata

  • Download URL: gmuse-0.3.0.tar.gz
  • Upload date:
  • Size: 3.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gmuse-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f7ae874f07a37d080fd76b2addffeab9bd28e9706d871b53fc6834f9a173b0ae
MD5 cfb2a93d8e7652f433a9c31e7d245d8f
BLAKE2b-256 c684159f6fdcd2d6c0eea64b8cc64e85c21f93ff1f739c66da4fead835e235ca

See more details on using hashes here.

File details

Details for the file gmuse-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: gmuse-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 52.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gmuse-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 777e34312f05be9d27f2fa118681726ae79d8792de52dccb2a23a632d16d0cb8
MD5 5dbf34c5a822d84755f3bc488c51112d
BLAKE2b-256 a43bbe321c5560a01653cfc75653e249c29c58dc5f89cd4b5ce30c1714f49714

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page