Metadata-Version: 2.4
Name: gmuse
Version: 0.2.1
Summary: AI generated commit messages.
Project-URL: Homepage, https://github.com/rvforest/gmuse
Project-URL: Documentation, https://gmuse.readthedocs.io/
Project-URL: Source, https://github.com/rvforest/gmuse
Project-URL: Issues, https://github.com/rvforest/gmuse/issues
Author-email: Robert Forest <rvforest@gmail.com>
License: MIT License
        Copyright (c) 2025 Robert Forest
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Version Control
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: litellm>=1.0.0
Requires-Dist: tomli>=2.0.0; python_version < '3.11'
Requires-Dist: tomlkit>=0.13.2
Requires-Dist: typer>=0.9.0
Provides-Extra: clipboard
Requires-Dist: pyperclip>=1.8.0; extra == 'clipboard'
Description-Content-Type: text/markdown

<!-- markdownlint-disable MD033 MD041 -->
<div align="left">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/rvforest/gmuse/main/docs/source/_static/logo/gmuse-logo-w-text-dark.png" width="250">
<img alt="gmuse Logo" src="https://raw.githubusercontent.com/rvforest/gmuse/main/docs/source/_static/logo/gmuse-logo-w-text-light.png" width="250">
  </picture>
</div>

# gmuse

[![GitHub](https://img.shields.io/badge/GitHub-rvforest%2Fgmuse-blue?logo=github)](https://github.com/rvforest/gmuse)
[![Read the Docs](https://img.shields.io/readthedocs/gmuse)](https://gmuse.readthedocs.io)

[![Checks](https://img.shields.io/github/check-runs/rvforest/gmuse/main)](https://github.com/rvforest/gmuse/actions/workflows/run-checks.yaml?query=branch%3Amain)
[![codecov](https://codecov.io/gh/rvforest/gmuse/graph/badge.svg?token=JXB4LR2241)](https://codecov.io/gh/rvforest/gmuse)

[![PyPI](https://img.shields.io/pypi/v/gmuse.svg)](https://pypi.org/project/gmuse/)
[![Python Versions](https://img.shields.io/pypi/pyversions/gmuse.svg)](https://pypi.org/project/gmuse/)

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/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. Ensure your LLM provider API key is set (e.g., `OPENAI_API_KEY`).
3. Load completions: `eval "$(gmuse git-completions zsh)"`
4. Stage changes: `git add .`
5. Test: `git commit -m <TAB>` — gmuse will suggest a message; confirm to use it.
6. Alternatively, generate a commit message directly: `gmuse msg`
7. Preview the prompt without calling LLM: `gmuse msg --dry-run`

See [Completions docs](https://gmuse.readthedocs.io/en/latest/how_to/completions.html) for configuration and how to persist the completion across sessions.

## Installation

```bash
# Basic installation
pip install gmuse

# With clipboard support
pip install gmuse[clipboard]
```

## Provider Setup

gmuse supports 100+ LLM providers via LiteLLM. Set your API key:

```bash
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 API keys (e.g., `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`).

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:

```bash
# 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
