AI-powered git commit message generator. Reads your staged changes and writes a conventional commit message using any OpenAI-compatible API.
- Generates Conventional Commits from your staged diff
- Uses your recent commit history for style-consistent output
- Interactive confirmation (
y/e/N) before committing - Dry-run mode with no side effects
- Three body styles: long, bullet list, paragraph
- Works with any OpenAI-compatible API (Ollama, LM Studio, OpenAI, …)
- Configuration managed from the CLI — no
.env
Requires Python 3.13+.
Run the latest version from PyPI without installing anything:
uvx git-autoc --helpInstall it once with uv tool install:
uv tool install git-autoc
git-autoc --helpThis puts two commands on your PATH:
git-autoc— a native git subcommand, sogit autocjust works in any repositoryautoc— a short standalone alias
To remove it later:
uv tool uninstall git-autocBoth installation modes work the same. This guide uses git autoc; replace it with uvx git-autoc or autoc as you prefer.
Stage the changes you want to commit, then run:
git autocThe tool generates a commit message, shows it, and asks how to proceed:
y— commit with the generated messagee— open the editor to adjust the message before committingN(default) — abort, keep changes staged
If nothing is staged but there are unstaged changes, you are asked whether to stage everything first. If the repository is clean, the tool exits.
To generate without committing (or to preview the message first):
git autoc --dry-run| Option | Alias | Description |
|---|---|---|
--dry-run |
-n |
Generate a message without committing |
--long |
-l |
Allow an optional body paragraph or bullet list |
--list |
Always add a bullet-list body | |
--desc |
Always add a paragraph body |
--long, --list, and --desc are mutually exclusive.
| Style | Flag | Behavior |
|---|---|---|
| Default | One-line message, no body | |
| Long | --long |
Body added only if the change is worth explaining |
| List | --list |
Body always present, as a bullet list |
| Description | --desc |
Body always present, as a single paragraph |
Configuration lives in ~/.config/git-autoc/config.toml.
Show the current configuration (creates a default file on first run):
git autoc configSet a value interactively:
git autoc config set openai_modelRemove the config file and directory:
git autoc config clear| Key | Default | Description |
|---|---|---|
openai_base_url |
http://localhost:11434/v1 |
Base URL of the OpenAI-compatible API |
openai_model |
model |
Model name to use |
openai_api_key |
(empty) | API key; leave empty for local providers |
openai_temperature |
0.2 |
Sampling temperature (0–1, lower is more deterministic) |
openai_max_tokens |
512 |
Maximum tokens in the generated response |
openai_base_url and openai_model are required and must be non-empty; the tool refuses to run otherwise.
- Providers — configure Ollama, LM Studio, OpenAI, or any other OpenAI-compatible API
- Troubleshooting — error messages and their fixes
- Contributing — development setup, conventions, and releasing
- CLI: typer + rich
- Config: pydantic + tomllib
- AI client: openai (OpenAI-compatible API)
- Quality: ruff, ty, pytest
For development setup, make commands, conventions, and releasing, see Contributing.