# 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 :

![](https://cdn.hashnode.com/uploads/covers/68054ab7538606b217ad7080/8761e7d5-281c-42c6-972d-a8a6a19193b8.png align="center")

### 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
