Skip to content

greedy854/commit-gen-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

commit-gen

A CLI tool that generates git commit messages from diffs using Claude.

How it works

  1. Reads a git diff from stdin
  2. Sends it to the Claude API with a prompt that enforces good commit message conventions
  3. Streams the result back to stdout

Setup

npm install
cp .env.example .env
# Add your Anthropic API key to .env

Usage

# Generate message from staged changes
git diff --cached | node index.js

# Generate message from last commit
git diff HEAD | node index.js

# Stage everything and commit in one go
git add -A && git diff --cached | node index.js | git commit -F -

Tech

  • Runtime: Node.js (ESM)
  • AI: Claude via @anthropic-ai/sdk, streamed output
  • Model: claude-sonnet-4-6

Output format

  • First line: imperative mood, max 72 chars
  • Optional body (blank line + 2–5 lines) explaining why, not what
  • No vague words, no markdown, no preamble

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors