git-aicommit-0.1.0 is not a library.
git-aicommit
A tiny Rust CLI that drafts a commit message from your staged changes using
Claude Code (Haiku), then opens
git commit with the message pre-filled so you can review, edit, or abort.
How it works
- Checks you're in a git repo and that something is staged.
- Feeds
git diff --cached(plus a--statsummary) toclaude -p --model haikuover stdin. - Cleans up the response and runs
git commit -e -m "<message>", inheriting your terminal so$EDITORopens normally.
Large diffs are truncated at 60KB to keep the prompt sane.
Requirements
- Rust (stable)
gitclaudeCLI, installed and authenticated
Install
From crates.io (requires Rust):
Pre-built binary — download from the latest release,
extract, and copy to a directory on your $PATH:
# Linux/macOS example
Build from source:
Naming the binary git-aicommit lets you invoke it as a git subcommand.
Usage
Your editor opens with the AI-generated message. Save to commit, or quit with an empty message to abort.
Notes
- The prompt asks for Conventional Commits style (
feat:,fix:, etc.), imperative subject ≤72 chars, optional body explaining the why. - Nothing is committed without your confirmation — the editor step is always run.
- No API key handling here; auth is delegated entirely to the
claudeCLI.