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
  • 💅 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

✏️ 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 🧙‍♂️


Parfait ! On peut alors ajouter une nouvelle section dans le README.md en anglais, pour expliquer l’usage d’un fichier de configuration, afin d’éviter de retaper tous les arguments à chaque fois. Je l’intègre juste après la section “Customization”, comme suit :


📦 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.


Souhaites-tu que je t’aide à implémenter la lecture de ce fichier .commitly-cli.json dans le code Python de ton projet ?


🔮 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


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.2.tar.gz (8.7 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.2-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: commitly_cli-1.1.2.tar.gz
  • Upload date:
  • Size: 8.7 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.2.tar.gz
Algorithm Hash digest
SHA256 04edf3458baf5827c8c9ee9baa9d8ed5676c07c137ee4f5c7dacc2074ee45d0f
MD5 8f8b7f3847e86f7083d7446b3b98d7bd
BLAKE2b-256 8e9fd710f795a04b9b188c782a81dd67111c7933677d905997a6a2eb709bc3fa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Commitly_cli-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ed93425adfa6e7426aa2b98f0d4a1a503655ee4579c1b39024f835dae5faf04f
MD5 889e879c279d42393575c21407c56c3c
BLAKE2b-256 671abec4229f45cd4134a8c53ea26264ac0e9ede5fcd97722cb337bb5dfd31ca

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