Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ai-git-commit

A zero-dependency CLI tool that generates smart, conventional commit messages by analyzing your git diff. No API keys, no cloud services — runs entirely locally using pattern matching.

Why?

Writing good commit messages is tedious. This tool analyzes your staged changes and suggests a Conventional Commits message based on what actually changed.

Install

npm install -g ai-git-commit

Or use directly with npx:

npx ai-git-commit

Usage

# Stage your changes first
git add .

# Generate a commit message
ai-git-commit

# Auto-commit with the generated message
ai-git-commit --commit

# Just print the message (for piping)
ai-git-commit --quiet

How It Works

  1. Reads your git diff --staged
  2. Analyzes file patterns, additions, deletions, and content
  3. Determines the commit type (feat, fix, docs, refactor, style, test, chore)
  4. Generates a descriptive scope and subject
  5. Outputs a conventional commit message

Examples

$ ai-git-commit
🔍 Analyzing staged changes...

📝 Suggested commit message:
  feat(auth): add JWT token validation middleware

Use --commit to auto-commit, or copy the message above.
$ ai-git-commit
🔍 Analyzing staged changes...

📝 Suggested commit message:
  fix(api): handle null response in user endpoint

Detection Rules

Pattern Type
New files added feat
Test files modified test
README/docs changed docs
Package files changed chore
Bug-related keywords fix
Style/format only style
Restructuring refactor

License

MIT

About

CLI tool that generates smart commit messages from your git diff. Uses pattern matching to suggest conventional commit messages — no API key required.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages