Skip to main content

git-autoc

AI-powered git commit message generator. Reads your staged changes and writes a conventional commit message using any OpenAI-compatible API.

Features

  • 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

Installation

Requires Python 3.13+.

Run the latest version without installing anything:

uvx git-autoc --help

Or install it as a command so git-autoc lands on your PATH:

uv tool install git-autoc
git-autoc --help

Usage

Stage the changes you want to commit, then run:

uvx git-autoc

The tool generates a commit message, shows it, and asks how to proceed:

  • y — commit with the generated message
  • e — open the editor to adjust the message before committing
  • N (default) — abort, keep changes staged

To generate without committing (or to preview the message first):

uvx git-autoc --dry-run

Options

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.

Body styles

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

Configuration lives in ~/.config/git-autoc/config.toml.

Show the current configuration (creates a default file on first run):

uvx git-autoc config

Set a value interactively:

uvx git-autoc config set openai_model

Settings

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.

Development

make run     # run the CLI
make format  # format code (ruff)
make check   # type check (ty) + lint + format check
make test    # run tests (pytest)

Project layout

src/git_autoc/
├── main.py           # CLI (typer), wires all layers
├── core/config.py    # settings, TOML loading, config management
├── git/utils.py      # git operations (diff, log, stage, commit)
└── llm/              # prompt building, provider, commit styles

Stack

  • CLI: typer + rich
  • Config: pydantic + tomllib
  • AI client: openai (OpenAI-compatible API)
  • Quality: ruff, ty, pytest

Download files

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

Source Distribution

git_autoc-0.2.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

git_autoc-0.2.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file git_autoc-0.2.0.tar.gz.

File metadata

  • Download URL: git_autoc-0.2.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for git_autoc-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b4fe3fe672f1c138781c52478fe91ab7ea3dc55c7eea04408323529ff3cd60ce
MD5 a28b9d5977258d8bed7dc53535fc3406
BLAKE2b-256 8f53c8b5a667f2700be5d5e707c6755b6df4d454501a8e3043fae49ea609ebf8

See more details on using hashes here.

File details

Details for the file git_autoc-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: git_autoc-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for git_autoc-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c9badfc179e19b4415135b8d4eb0ebd3d03ae38178bf8525e1653e6dee1c52c
MD5 0123c1ab00210c18d613457450f52d5a
BLAKE2b-256 2099059a7f3d5fc6ee21b9a7cc59db3d98aa0f5283c8ad80b68877f45e31508e

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