Skip to main content

I Built My First npm Package, and It Solves a Tiny Git Problem

Updated 3 min readMarkdown
I Built My First npm Package, and It Solves a Tiny Git Problem

If you write code every day, you probably write Git commit messages every day too.And if you're honest… you probably don’t enjoy it.

I definitely didn’t.

So I built a small tool that fixes this tiny but annoying problem. It’s called slothcommit , an AI-powered CLI that generates commit messages for you.

yeah so i decided to write this blog on "my first npm package" , why I built it, and what I learned along the way.

The Problem: Writing Commit Messages is Annoying

My typical workflow looked something like this:

  1. Write some code
  2. Stage the files git add .
  3. Then get stuck writing a commit message.

Sometimes I would write something lazy like:

fix stuff

Or something even worse:

update

When I did want a good commit message, the workflow was painful:

  1. Copy my code changes
  2. Paste them into ChatGPT
  3. Ask it to generate a commit message
  4. Copy the result back
  5. Finally run git commit

It worked but thing is it was slow and repetitive and focus am lazy asf so i wanted a more lazier way to do this git commit message thing.

So I thought:

Why can't a CLI tool just do this automatically?

That idea became slothcommit.

The Idea Behind Slothcommit

The idea was simple.

Instead of manually writing commit messages, a CLI tool should:

  1. Look at the git diff
  2. Send it to an AI model
  3. Generate a clean conventional commit message
  4. Run the commit automatically

So the workflow becomes:

git add .

sloth

And that's it.

workflow diagram :

What Slothcommit Does (or how it works)

slothcommit is an AI-powered Git commit assistant.

It analyzes your staged changes and generates a commit message using the Conventional Commit format.

Example output:

feat(auth): add refresh token middleware

and while am writing this blog the package is now getting 100+ downloads every week, which is really encouraging to see!

and in case you like it ? do give it a star https://github.com/lelixn/sloth.git

A small takeaway

This project reminded me that building developer tools doesn't always require some revolutionary idea.

Sometimes you just get annoyed by something you do every day, decide to fix it, and end up learning a lot in the process.

For me, that annoyance was writing Git commit messages.

And that's how my first npm package happened.

Build things. Solve your own problems. Publish them. You never know who else might need them.

— Lelixn

6 views

About the author

  • Look, I'm a full-stack developer, and I'm here to build. My weapon of choice? The MERN stack for web solutions that scale, and I've got the Java backend chops to back it up. I dig deep into designing RESTful APIs and wrangling databases, always aiming for UIs that are smooth as butter. And trust, Postman is on heavy rotation for making sure those APIs are hitting just right. On the hunt for a job that'd freak out people.

No comments yet. Be the first to comment.