Skip to main content

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 commitly is 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
  • 🧩 --fact: split your diff into multiple smaller commits (NEW!)
  • 💅 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.txt for 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

🧩 Factorized Commits: --fact

Tired of cramming too much into a single commit? Let commitly-cli analyze and split your changes into multiple logical commits.

Use the --fact flag to enable intelligent factorization:

commitly-cli --add . --fact

The tool will:

  • Inspect your Git diff
  • Group related changes together
  • Suggest several clean, focused commit messages

Each proposed commit will include:

  • A message
  • A list of files impacted
  • A logical theme (bug fix, refactor, doc update, etc.)

You can then confirm and apply them step by step.

Perfect for big features, large cleanups, or batch updates 🧠


✏️ 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
--fact Enables smart commit factorization
--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.json
  • commitly-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
  • ⚙️ Config file for reusable options (now detected automatically!)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

commitly_cli-1.1.5.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Commitly_cli-1.1.5-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file commitly_cli-1.1.5.tar.gz.

File metadata

  • Download URL: commitly_cli-1.1.5.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for commitly_cli-1.1.5.tar.gz
Algorithm Hash digest
SHA256 babbadb08a9b6d9f48823e6c0ee5b1d4432a21144127ace9e7323192e7d79f95
MD5 a500fe7fd837525eb6a4a7121bd44011
BLAKE2b-256 f4b90668b285f85892f3bd39f646e5023efd8f1fe903bef323a43387921c7da0

See more details on using hashes here.

File details

Details for the file Commitly_cli-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: Commitly_cli-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for Commitly_cli-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 73a31f47141777f5b4b70caa795635b2b24df7d280000eaec2dcd74a7eb07140
MD5 9eac9a9971243e12a4a6ea93ee54775c
BLAKE2b-256 b5bc83fe9ac3a40fad75b209d89a4a4956d3be300acc18a24eb59042641b03bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page