Skip to content

icgriggs14/claude-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

claude-commit

npm version npm downloads Sponsor

AI-powered conventional commit message generator using Claude Haiku. Reads your staged diff → calls Claude → outputs a properly formatted commit message in seconds.

Quick start

npx claude-ai-commit

No install required. Set ANTHROPIC_API_KEY and go.

Install globally

npm install -g claude-ai-commit

Usage

# Generate commit message from staged changes
claude-commit

# Include all unstaged changes too
claude-commit --all

# Force a specific commit type
claude-commit --type feat

# Generate AND auto-commit
claude-commit --commit

# Use a different Claude model
claude-commit --model claude-sonnet-4-6

# Dry run (no API call)
claude-commit --dry-run

Output example:

feat(auth): add OAuth2 PKCE flow for mobile clients

Husky pre-commit hook

Automatically generate commit messages as you commit:

# .husky/prepare-commit-msg
npx claude-ai-commit --staged >> "$1"

Or add to package.json:

{
  "scripts": {
    "prepare": "husky install"
  }
}

Spreads via dotfiles — every collaborator who clones your repo gets it too.

Configuration

Option Default Description
--staged true Review staged diff only
--all false Include all unstaged changes
--type <type> auto Force commit type (feat|fix|chore|docs|refactor|test|style|perf|ci)
--commit false Auto-run git commit -m <message>
--model claude-haiku-4-5-20251001 Claude model to use
--dry-run false Print what would happen without calling Claude

Environment variable: ANTHROPIC_API_KEY (required)

Also try

claude-pr-review — Claude-powered code review CLI for any git repo. Pair it with claude-commit for a complete AI-assisted git workflow.

Support

If claude-commit saves you time, consider sponsoring on GitHub. Every dollar helps keep this maintained and free.

License

MIT

About

AI-powered conventional commit message generator using Claude Haiku — git diff → perfect commit message

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors