DEV Community

LakshitSharma1
LakshitSharma1

Posted on

I built a CLI tool that writes your git commit messages using Claude AI

We've all written terrible commit messages.

git commit -m "fix"
git commit -m "stuff"
git commit -m "changes pls work"

I got tired of it. So I built claude-autocommit — a CLI tool that reads your staged git diff and automatically generates a meaningful commit message using Claude AI.

How it works

git add .
claude-autocommit
# ✅ feat: add user authentication with JWT tokens
Enter fullscreen mode Exit fullscreen mode

That's it. One command. Done.

Tech Stack

  • TypeScript
  • Claude API (Anthropic)
  • Node.js CLI

Installation

npm install -g @lakshitsharma1/claude-autocommit
Enter fullscreen mode Exit fullscreen mode

Set your API key:

# Windows
$env:ANTHROPIC_API_KEY="your-key"

# Mac/Linux
export ANTHROPIC_API_KEY="your-key"
Enter fullscreen mode Exit fullscreen mode

Then just run:

git add .
claude-autocommit
Enter fullscreen mode Exit fullscreen mode

What I learned

Building a CLI tool from scratch taught me a lot about how npm packages work, how to structure TypeScript projects, and how easy it is to integrate Claude API into real tools.

The whole project is open source — contributions welcome!

Links

If this seems useful, drop a ⭐ on GitHub!

Top comments (0)