CLI tool to generate structured Git commit messages using AI.
Project description
commitly-cli 🚀🤖
Never write "final commit" or "modifs 2" again in your Git history.
commitly-cli is a stylish command-line interface powered by Rich, built on top of the commitly library. It generates smart, structured, and elegant Git commit messages for you — so you can focus on your code.
🧠 Why commitly-cli?
You run git commit -m "", then… you freeze.
😩 You’re thinking: “What should I write here?”
With commitly-cli, let the AI do it for you.
It reads your staged changes (git diff --cached), understands what you’ve done, and crafts a clean, contextual message.
Think of it as your Git copilot ✈️
🧰 Requirements
- Python 3.7+
- Git installed
🧪 Installation
Install via pip:
pip install commitly-cli
Or clone it locally:
git clone https://github.com/Tostenn/commitly-cli.git
cd commitly-cli
python main.py --help
Make sure
commitlyis also installed:pip install commitly
✨ Key Features
- 🧠 AI-powered commit message generation
- 🔍 Automatic Git diff analysis
- 🧩 Intelligent commit splitting: breaks complex changes into logical commits
- 💅 Fully customizable format, tone, and content
- 🏷️ Auto-injects ticket numbers (e.g.,
#42) - ✅ Optional confirmation mode with message editing (
commit.txt) - 🔄 Integrated Git flow (
add,commit,push) - 🎨 Beautiful output with Rich
- 🤖 Bonus: a fancy logo just for fun 😎
🛠️ Basic Usage
commitly-cli --add . --confirm
This will:
- Stage all files
- Generate a commit message using AI
- Save it in
commit.txtfor manual review - Ask for confirmation before committing
With a ticket
commitly-cli --add . --confirm --ticket "#25"
The ticket number is automatically included in your message.
🚀 Advanced Example
commitly-cli \
--add script.py README.md \
--style my-style.txt \
--format my-format.txt \
--recommandation my-hints.txt \
--ticket #42 \
--push \
--confirm
This will:
- Add selected files
- Use your custom style/format/guidelines
- Link to a ticket
- Let you review and edit the message
- Commit and push it to the remote repo
✏️ Need to tweak the message?
When using --confirm, a commit.txt file is created. You can edit it before finalizing.
Then continue with:
python main.py --continue
🧪 Upcoming: --dry-run mode (in the next version)
Preview the generated message without making a real commit:
commitly-cli --add . --ticket "#123" --dry-run
This feature will let you test your message templates safely. (Currently under development – stay tuned!)
🔍 Available Options
| Argument | Description |
|---|---|
-a, --add |
Files to stage (default: .) |
-f, --format |
Path to commit message format file |
-s, --style |
Path to writing style definition |
-r, --recommandation |
Tips or constraints to guide the AI |
-t, --ticket |
Ticket number to include (e.g. #42) |
-p, --push |
Push after committing |
--confirm |
Enables message review/edit before committing |
-c, --continue |
Commits using the content of commit.txt |
--dry-run |
(Coming soon) Simulates message generation |
--show-format |
Display default format |
--show-style |
Display default style |
--show-recommandation |
Display default guidance rules |
--del-temp |
Delete commit.txt after use |
💡 Tip: use
--add !to skip staging entirely.
✍️ Customization
Fine-tune commit generation with your own:
style.txt: tone (formal, technical, playful...)format.txt: structure (type, module, message...)recommandation.txt: additional rules or reminders
🧪 Common Scenarios
🧹 Quick fix
commitly-cli --add . --ticket "#123" --confirm
Easy: auto-stage, tag, suggest, review, commit.
🧱 Large commit with consistency
commitly-cli \
--add . \
--style formal.txt \
--format conventional.txt \
--recommandation rules.txt \
--ticket "#88" \
--push \
--confirm
Maintain consistency across big code changes like a pro 💼
💥 Fun Fact: commitly-cli wrote itself
This very project is the best demo of commitly-cli.
🛠️ The first 2 commits were hand-written.
From the third commit onward, commitly-cli took the wheel. At first, it wasn't great. Here's the actual result from its first attempt:
git commit -m "```"
Yes — triple backticks as the commit message.
Why? Because the training example used "commit message here"… and the AI took that literally 😅
Since then, it's grown a lot — smarter, more structured, and reliable.
Want to see the evolution?
Check out the Git history:
git log
It’s like watching an AI grow from 🐣 to 🧙♂️
📦 Config File (no more long commands!) (Coming soon)
You can define your default options once in a config file to avoid repeating them every time.
✅ Supported config file names:
.commitly-cli.jsoncommitly-cli.json
Place it in the root of your Git project or in your home directory.
📄 Example:
{
"add": ".",
"confirm": true,
"ticket": "#88",
"style": "my-style.txt",
"format": "my-format.txt",
"recommandation": "my-rules.txt",
"push": true
}
Once the file is detected, you can run simply:
commitly-cli
Command-line arguments always override the config file.
🔮 Next Steps
🧪 In development:
- 💡
--dry-run: preview message output (no real commit) - 📁 Smarter file selection (relevant diffs only)
- 🧠 Git hooks (
pre-commit) integration - ✍️ Suggest tags/branches
- 🎨 Lightweight web UI
- 🧩 Extension for Visual Studio Code
Want more? Open an issue or contribute!
🤝 Built on
🧠 commitly: The engine that turns your Git diff into a smart message. commitly-cli is just the steering wheel.
💬 Final Word
Still using:
git commit -m "change"
git commit -m "test again"
git commit -m "final final final"
Upgrade your commit game. Make your Git history shine like a pro 💎
🐛 Issues? Feedback?
Open an issue — or reach out directly.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file commitly_cli-1.1.4.tar.gz.
File metadata
- Download URL: commitly_cli-1.1.4.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a229720b6daa28aa9522918314acaae72d7921a7de945c8912043d2b50fe61f7
|
|
| MD5 |
5567d9ab5835f246f4bd9c7aeeaf1a67
|
|
| BLAKE2b-256 |
b8654553f06eb49353d264c72ff86701a7d3d2a960b6db44c55085e41e331752
|
File details
Details for the file Commitly_cli-1.1.4-py3-none-any.whl.
File metadata
- Download URL: Commitly_cli-1.1.4-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae366553f76545b6c560f58d1bddd3363755de1ae013eca803fe1a5b2221b075
|
|
| MD5 |
f6c3ecb7ccce6a5c6b13ded13b00427c
|
|
| BLAKE2b-256 |
061ef48328defc286a736acd675e6c2b994601c713b27ffdf967d05ba41263b9
|