DEV Community

z z
z z

Posted on

I Built a CLI Tool That Writes Better Git Commits Than I Do

Have you ever stared at a terminal after git commit, trying to remember what you changed?

I have. Every single day.

Then I'd type "fixed stuff" or "update" and move on. Six months later, every git log was a graveyard of useless messages.

So I built git-copilot.

What it does

$ git add .
$ git-copilot gen
✨ feat(api): add user routes and controller
3 file(s), +124/-15 lines
Enter fullscreen mode Exit fullscreen mode

Reads your staged diff, analyzes the files, and generates a conventional commit message. About 5 seconds.

How it works

No AI. No API calls. No internet. Pure Python stdlib with smart heuristics.

Change Auto-detects
src/*.py, *.js feat
_test.py, spec.js test
README.md, docs/* docs
Dockerfile, .github/ build or ci
*.css, *.scss style

Scope is inferred from directory names - api/, ui/, db/, auth/, config/. Breaking changes detected from migration files or BREAKING CHANGE keywords.

Install

pip install git-copilot
Enter fullscreen mode Exit fullscreen mode

Or from GitHub:

git clone https://github.com/zhirenhun-stack/git-copilot
cd git-copilot && pip install -e .
Enter fullscreen mode Exit fullscreen mode

Usage

git-copilot gen
git-copilot gen --type fix
git-copilot config
git-copilot init
Enter fullscreen mode Exit fullscreen mode

Pro Pack ($4.99)

The free version is fully functional and open source. The Pro Pack includes:

  • 3 premium templates (Angular-style, Emoji-only, Minimal)
  • GitHub Actions CI integration for commit linting
  • Commit convention cheatsheet
  • VS Code snippets for auto-complete
  • Custom scope mappings
  • Lifetime updates

Get the Pro Pack

Why

I got tired of writing "wip" for every commit. Now I run git-copilot gen | git commit -F - and get back to coding. Clean commits, every time.


Repo: https://github.com/zhirenhun-stack/git-copilot
Pro Pack: https://zhirenhun.gumroad.com/l/git-copilot-pro

Top comments (0)