A lightweight CLI tool that generates clean, Conventional Commit messages from your staged Git changes using OpenAI — fast, minimal, and dependency-free.
TL;DR • Key Features • Quickstart • License
gitsloth is a minimal Go CLI that reads your staged Git diff (along with your branch name and status), generates one or more Conventional Commit messages using OpenAI, lets you pick the best one, and then commits it — or copies it to your clipboard.
- Writing good commit messages is repetitive
- Conventional Commits are useful but tedious
- This tool automates it without adding complexity
It focuses on:
- zero unnecessary dependencies
- simple UX
- predictable output
- AI-Generated Commit Messages – Uses OpenAI to turn diffs into clean Conventional Commits
- Multiple Suggestions – Generate several commit messages and pick the best one
- Rich Git Context – Sends branch name, status, and diff together for better accuracy
- Conventional Commits Ready – Enforces proper format and style automatically
- Interactive Selection – Choose your preferred message when generating multiple options
- Confirmation Flow – Confirm before committing when generating a single message
- Clipboard Support – Copy the selected message instead of committing
- Zero Dependencies – Uses only the Go standard library
- Fast CLI Workflow – Designed to fit seamlessly into your Git routine
git clone https://github.com/saccofrancesco/gitsloth.git
cd gitsloth
go build -o gitslothexport OPENAI_API_KEY=your_api_key_here# Generate a single commit message (with confirmation)
./gitsloth
# Generate multiple messages and choose one
./gitsloth -g 3
# Stage everything before generating
./gitsloth -a
# Copy selected message to clipboard instead of committing
./gitsloth -c| Flag | Shorthand | Description |
|---|---|---|
--generate |
-g |
Number of commit messages to generate |
--all |
-a |
Stage all changes before generating |
--clipboard |
-c |
Copy the selected message instead of committing |
$ ./gitsloth
⣾ Generating commit message...Proposed commit message:
feat: add clipboard support and structured git context
Accept and commit? (y/n):$ ./gitsloth -g 3
⣾ Generating commit messages...Generated commit messages:
1) feat: add clipboard support
2) feat: implement clipboard integration for commits
3) refactor: improve commit message generation flow
Select a message (number) or 0 to abort:gitsloth is emailware. If you find it useful or interesting, I'd like to hear from you.
📩 francescosacco.github@gmail.com
If you like this project:
- ⭐️ Star the repo
- ☕️ Buy me a coffee
- 💌 Send feedback or ideas
📎 You Might Also Like…
- Deepshot: Predict NBA games using machine learning and advanced stats
- Supremebot: A NiceGUI-powered bot for Supreme drops
This project is licensed under the MIT License — feel free to use it in your own projects!
GitHub @saccofrancesco