CLI that drafts Conventional Commits from staged git diffs with Claude, then commit, cancel, or edit.
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 addis what gets summarized. - The API key is never printed in full;
showuses 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:
- Environment variable
ANTHROPIC_API_KEY - Config file
~/.messygit/config.json(written bymessygit 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
- If there is nothing staged, messygit tells you to run
git addfirst. - Otherwise it sends the staged diff to Claude and prints a suggested one-line message.
- You are prompted: commit (default), no (cancel), or edit (open
$EDITORto change the message). - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file messygit-0.1.1.tar.gz.
File metadata
- Download URL: messygit-0.1.1.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.13.5 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cd251329afb4db87f5faef70740f94d931792bdb2b7acb6bd93382065666a46
|
|
| MD5 |
5b7ac85ef9e7c51c3b6f799d7f40fab3
|
|
| BLAKE2b-256 |
439d3f7a5692ebf5fb2244c63ad584109f3b40fac9038297e1d98f0452ec65ad
|
File details
Details for the file messygit-0.1.1-py3-none-any.whl.
File metadata
- Download URL: messygit-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.13.5 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96bf1e642891a7aca2b355d100896478f7ac4dcca49f1c512cfb464d0b71ec5c
|
|
| MD5 |
c402f0505f0c411e2232fe6c8f474dd3
|
|
| BLAKE2b-256 |
64c7c011ac42e9c43f57c649dc0883d765b48f7c73877a27f19cb01ade905ef7
|