Skip to content

tolgazorlu/ez-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ez-commit

A lightweight Go CLI that uses Claude to analyze your uncommitted git changes and automatically execute a series of logical, atomic commits with Conventional Commit messages.

How it works

  1. Runs git diff -U0 to capture all uncommitted changes
  2. Sends the diff to Claude with a strict JSON-only system prompt
  3. Claude returns a structured array of CommitTask objects — each a logical atomic commit
  4. You confirm (or skip) each proposed commit interactively
  5. ez-commit stages the relevant files and commits them one by one

Installation

go install github.com/tolgazorlu/ez-commit@latest

Or build from source:

git clone https://github.com/tolgazorlu/ez-commit
cd ez-commit
go build -o ez-commit .

Usage

# Preview proposed commits without committing anything
ez-commit --dry-run

# Interactive mode: confirm each commit before it's applied
ez-commit

Requirements

Set your Anthropic API key:

export ANTHROPIC_API_KEY=sk-ant-...

Example output

Found 3 hunk(s). Consulting Claude...

Claude proposed 2 commit(s):

─────────────────────────────────────────
Commit 1 / 2
  Message  : feat: add user authentication handler
  Rationale: Auth logic is independent from the API refactor
  Files    :
             internal/auth/handler.go
  Hunks    : 2 hunk(s)

Stage and commit this? [Y/n]:
  ✓ Committed: feat: add user authentication handler

─────────────────────────────────────────
Commit 2 / 2
  Message  : refactor: extract database query helpers
  Rationale: DB helper extraction is a separate concern from auth
  Files    :
             internal/db/queries.go
  Hunks    : 1 hunk(s)

Stage and commit this? [Y/n]:
  ✓ Committed: refactor: extract database query helpers

Done.

About

AI-powered CLI tool to decompose messy changes into clean, logical, and atomic git commits.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages