An AI-powered interactive git CLI with agentic tools for commits, code suggestions, and workflow automation.
Project description
messygit
messygit is an interactive CLI that turns messy git workflows into clean Conventional Commits — stage, commit, push, and get AI-powered project suggestions, all from one interface powered by Claude.
Why use it
- Interactive REPL — one command drops you into a persistent session where you can stage, commit, push, and more without leaving.
- AI commit messages — sends your staged diff to Claude and suggests a clean Conventional Commits subject line.
- Project suggestions — an AI agent inspects your repo and recommends concrete next steps.
- Token usage & cost — tracks the tokens each session uses and shows a rough cost estimate, with a one-command jump to billing.
- Themed UI — a colored startup animation and prompt you can recolor with the
themecommand. - Safe by default — only the staged diff is sent to the model. Your API key is never printed in full.
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
Install from source
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
You can set the key from within the messygit interface:
messygit > config YOUR_ANTHROPIC_API_KEY
Usage
messygit
This drops you into the interactive interface — an animated banner followed by a status dashboard, then the prompt:
mmm mmmm eeeeeee sssssss sssssss yy yy ggggggg ii tttttttt
mm mm mm mm ee ss ss yy yy gg ii tt
mm mmm mm eeeee sssssss sssssss yy gg ggg ii tt
mm mm ee ss ss yy gg gg ii tt
mm mm eeeeeee sssssss sssssss yy ggggg ii tt
repo messygit ⎇ main
status 3 staged · 2 modified
api key sk-ant-a...x3f2 (config)
model Haiku 4.5 $1 in · $5 out / 1M
tokens 0 used this session
────────────────────────────────────────────────────────────
Type help for commands · quit to exit
messygit (main) ❯
Commands
Commands are grouped on the help screen:
git
| Command | Description |
|---|---|
add <file> or add . |
Stage files for commit |
commit |
Generate an AI commit message from staged changes, then commit / cancel / edit |
push |
Push commits to remote |
messyagent
| Command | Description |
|---|---|
suggest |
Get AI-powered next-step suggestions for your project |
account
| Command | Description |
|---|---|
config <key> |
Save your Anthropic API key to ~/.messygit/config.json |
show |
Display a masked API key and its source |
model or model <name> |
Switch the Claude model (run model to list models and pricing) |
tokens |
Show this session's token usage and estimated cost, and open the billing console |
app
| Command | Description |
|---|---|
theme or theme <name> |
Change the UI color (run theme to list presets) |
help |
List available commands |
quit / exit |
Exit messygit |
Typical flow
messygit > add .
Staged everything
messygit > commit
feat(cli): add interactive REPL with ASCII banner
Commit with this message? [y/n/e] y
messygit > push
Tip: run
suggestfor AI next-step ideas, orthemeto recolor the UI.
Commit message style
The model follows Conventional Commits: type(scope): description
Allowed types: feat, fix, docs, style, refactor, test, chore. Subjects are one line, imperative, lowercase, no trailing period.
Token usage & cost
messygit tracks the tokens used by AI commands (commit, suggest) for the current session and shows a running total after each call. Run tokens for a breakdown and a one-key jump to the Anthropic billing console:
messygit > tokens
╭─ token usage ─────────────────────────────╮
│ used 8,420 tokens │
│ 6,200 in · 2,220 out │
│ requests 2 │
│ est cost ≈ $0.02 │
╰───────────────────────────────────────────╯
The cost is a rough estimate at the selected model's pricing. The Anthropic API does not expose remaining account credits, so usage and cost are measured per session only.
Choosing a model
messygit defaults to Claude Haiku 4.5 (fast and cheap). Use model to list the available models and their token pricing, or model <name> to switch (your choice persists in ~/.messygit/config.json):
messygit > model
Available models — usage: model <name>
● haiku Haiku 4.5 $1 in · $5 out / 1M (current)
sonnet Sonnet 4.6 $3 in · $15 out / 1M
opus Opus 4.8 $5 in · $25 out / 1M
messygit > model opus
! Opus 4.8 costs more than Haiku 4.5 ($5 in · $25 out / 1M vs $1 in · $5 out / 1M). Token usage will be billed at the higher rate.
Switch anyway? [y/N]:
Switching to a more expensive model prompts for confirmation first. The session cost estimate prices each request at the model used for it, so it stays accurate even if you switch mid-session.
Publishing to PyPI
This project uses GitHub Actions with PyPI trusted publishing — no API tokens needed in your repo.
One-time setup
- Go to your project on pypi.org
- Add a Trusted Publisher:
- Owner: your GitHub username
- Repository:
messygit - Workflow name:
publish.yml - Environment: leave blank
To release a new version
- Bump
versioninpyproject.toml - Commit and push
- Create a GitHub release:
git tag v0.2.0
git push origin v0.2.0
- Go to GitHub → Releases → Draft a new release → select the tag → Publish
The workflow at .github/workflows/publish.yml will automatically build and upload to PyPI.
Manual publish (without CI)
rm -rf dist/
python -m build
twine upload dist/*
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.3.0.tar.gz.
File metadata
- Download URL: messygit-0.3.0.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff5dcb192c946af7d37791c5166ef3bb760e5fd266add847eb92874a9baa9fdd
|
|
| MD5 |
2078487e1f46b52de818e9d6867d482d
|
|
| BLAKE2b-256 |
2e6b1435ac4089d9e11e77ae58e15dbc7450d970a587f7b61e6c1df2189d54ac
|
Provenance
The following attestation bundles were made for messygit-0.3.0.tar.gz:
Publisher:
publish.yml on jaytan3966/messygit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
messygit-0.3.0.tar.gz -
Subject digest:
ff5dcb192c946af7d37791c5166ef3bb760e5fd266add847eb92874a9baa9fdd - Sigstore transparency entry: 1877350507
- Sigstore integration time:
-
Permalink:
jaytan3966/messygit@ba6c04bb3c9e2e7d2f367186829ffb09d1064019 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/jaytan3966
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ba6c04bb3c9e2e7d2f367186829ffb09d1064019 -
Trigger Event:
release
-
Statement type:
File details
Details for the file messygit-0.3.0-py3-none-any.whl.
File metadata
- Download URL: messygit-0.3.0-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
866ed72c7c7dd2f471860bc4e98a062d210883c604c667d360712d46431e5a20
|
|
| MD5 |
323c0b80e0626a5e611c1ff55cbf787e
|
|
| BLAKE2b-256 |
a454381da24a138d7400fe659bbd3f490abc8db1a5fb496ad3c6786be0898946
|
Provenance
The following attestation bundles were made for messygit-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on jaytan3966/messygit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
messygit-0.3.0-py3-none-any.whl -
Subject digest:
866ed72c7c7dd2f471860bc4e98a062d210883c604c667d360712d46431e5a20 - Sigstore transparency entry: 1877350745
- Sigstore integration time:
-
Permalink:
jaytan3966/messygit@ba6c04bb3c9e2e7d2f367186829ffb09d1064019 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/jaytan3966
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ba6c04bb3c9e2e7d2f367186829ffb09d1064019 -
Trigger Event:
release
-
Statement type: