Skip to main content

Interactive CLI that turns messy git workflows into clean Conventional Commits — stage, commit, push, as well as agentic functionality, all from one interface.

Project description

messygit

messygit is a command-line tool that reads your staged Git changes, asks Claude (via the Anthropic API) to suggest a Conventional Commits subject line, and then lets you commit, cancel, or edit the message before running git commit.

Why use it

  • Keeps commit subjects consistent (feat(scope): describe the change) without thinking up wording from scratch.
  • Only the staged diff is sent to the model—what you git add is what gets summarized.
  • The API key is never printed in full; show uses a masked preview.
  • Clear errors for missing keys, rejected keys, and billing or zero-balance situations.

Requirements

  • Python 3.10 or newer
  • Git (run inside a repository)
  • An Anthropic API key with access to the Messages API

Installation

pip install messygit

This installs the messygit command (see [project.scripts] in pyproject.toml).

Install from source

From a checkout of this project:

cd messygit
python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -e .

API key

messygit resolves the key in this order:

  1. Environment variable ANTHROPIC_API_KEY
  2. Config file ~/.messygit/config.json (written by messygit config)

If neither is set, the default command exits with a short message explaining how to fix it.

Save a key to the config file:

messygit config --key YOUR_ANTHROPIC_API_KEY

Show a masked key (which source is active, without revealing the secret):

messygit show

Usage

Typical flow:

git add .
messygit
  1. If there is nothing staged, messygit tells you to run git add first.
  2. Otherwise it sends the staged diff to Claude and prints a suggested one-line message.
  3. You are prompted: commit (default), no (cancel), or edit (open $EDITOR to change the message).
  4. On confirmation, it runs git commit -m "..." with your chosen text.

Commands

Command Description
messygit Generate a message from git diff --staged, then prompt to commit / cancel / edit.
messygit config --key KEY Store the Anthropic API key under ~/.messygit/config.json.
messygit show Print a masked API key and whether it comes from the environment or config file.

Commit message style

The model is instructed to follow Conventional Commits, for example:

feat(auth): validate refresh tokens

Allowed types include: feat, fix, docs, style, refactor, test, chore. Subjects are one line, imperative, lowercase, no trailing period, and kept within a reasonable length (see your prompts in the package if you customize behavior).

Development

Without installing the package, from the repository root (the directory that contains the messygit package folder):

.venv/bin/python -m messygit.cli

Subcommands:

python -m messygit.cli config --key YOUR_KEY
python -m messygit.cli show

License

MIT (see pyproject.toml).

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

messygit-0.2.0.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

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

messygit-0.2.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: messygit-0.2.0.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for messygit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c4035f9d646ff1a698e8137321a616ee50bb9c78a7f8805c57a7ef6db2843275
MD5 d3bfb1fb19e77094dd2000c04d178530
BLAKE2b-256 6f17d8d4863e215f68038feb045b87cd985495dccedb3f5907dc711da1a4520e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: messygit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for messygit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07801b31c691bb11d485cfac5481a8bc1025591d6674549997928f432fb612f6
MD5 0ed47b2bfdbb45241cb191af07b2d069
BLAKE2b-256 aeb6b254ca939ddc49d820ddc6ca22fa540002466c3a0f1ce6637cbd3941f72f

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