Skip to main content

A CLI tool that writes your git commit messages.

Project description

🤖 AI Commit: The CLI That Writes Your Commits

Stop writing "wip", "fix", or "updates" today. Let AI analyze your code and write the perfect commit message while you sip your coffee.

PyPI - Version Python AI License


⚡ Why Use This?

You just spent 3 hours debugging a race condition. The last thing you want to do is summarize 15 files of changes into a string of text.

AI Commit reads your staged changes, understands the context, and generates a structured, meaningful commit message instantly.

  • ✨ Intelligent: Distinguishes between a feat, fix, and chore.
  • 🎭 Chameleon Mode: Switch tones from "Hardcore Developer" (technical jargon) to "Project Manager" (business value) instantly.
  • 📏 Strict or Casual: Enforce Conventional Commits for your repo, or use natural language for personal projects.

📦 Installation

Prerequisites

Get Started

  1. Clone the repo:

    pip install ai-commit
    

    Use pip3 if you are on Mac/Linux

    💡 Tip: To update to the latest version later, just run:

    pip install --upgrade ai-commit-cli

  2. Configure your Key:

    ai-commit config --key "YOUR_GEMINI_API_KEY"
    

    💡 Tip: If you skip step 3, don't worry! The first time you run ai-commit commit, the tool will detect the missing key and ask you to paste it securely.


🚀 Usage

The "I'm Feeling Lucky" Workflow

Stage your files and let the AI do the rest.

git add .
ai-commit commit

The tool will generate a message, show you a preview, and ask for confirmation before committing.


🎛️ Power User Controls

Don't like the default output? Override everything on the fly.

Flag Description Example Available Options
--type Force a specific commit type --type fix feat, fix, docs, chore, refactor, etc.
--tone Change the AI persona --tone manager developer (default), manager
--style Change the message format --style natural conventional (default), natural
--model Use a smarter/different model --model gemini-2.5-pro gemini-2.5-flash, gemini-2.5-pro
--auto YOLO Mode: Commit without asking --auto

🎭 The "Persona" Feature

This is where the magic happens. You can configure ai-commit to sound exactly how you need it to.

👨‍💻 Tone: Developer (Default)

Focuses on technical implementation details, function names, and logic.

Message: feat(auth): implement JWT validation in middleware

👔 Tone: Manager

Focuses on user impact, business value, and high-level summaries.

Message: feat(auth): enable secure user login to improve system safety


Try it:

```bash
ai-commit commit --tone manager
```

⚙️ Configuration

Set it and forget it. Your preferences are saved globally in ~/.ai-commit-config.json.

Set your favorite model: ai-commit config --model gemini-2.5

Set your default style: ai-commit config --style conventional


📂 Project Structure

If you want to hack on the source code, here is how the magic is organized:

.
├── setup.py             # The installer
└── ai_commit/           # The brains
    ├── cli.py           # Command line interface (Click)
    ├── model.py         # The "Mega Prompt" & Logic
    ├── git_reader.py    # Reads your staged diffs
    └── config.py        # Manages your API keys/settings

🤝 Contributing

Got a better prompt? A new persona?

  1. Fork the Project

  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)

  3. Commit your Changes (ai-commit commit) — See what I did there?

  4. Push to the Branch (git push origin feature/AmazingFeature)

  5. Open a Pull Request


🔮 Future Scope

We are just getting started! Here is what we are planning for v2.0:

  • 🧠 Multi-LLM Support: Add support for OpenAI (GPT-4), Anthropic (Claude), and local Ollama models for privacy-focused users.
  • 📜 Auto-Changelog: Automatically generate a CHANGELOG.md file based on your commit history.
  • 🌍 Multi-Language: Generate commit messages in languages other than English (Spanish, French, Chinese, etc.).
  • 🖥️ GUI Mode: A simple desktop app for users who prefer clicking over typing commands.
  • 🔍 pre-commit Hook Integration: Official support for the pre-commit framework to run checks automatically.

Have an idea? Open an Issue and let's discuss it!


Built with ❤️ and ☕.

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

commit_genie-1.0.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

commit_genie-1.0.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file commit_genie-1.0.0.tar.gz.

File metadata

  • Download URL: commit_genie-1.0.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for commit_genie-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a410dfc7f35540734f97e4aa310413642a5ba8dbbb8bd93ec5e8442076967b4b
MD5 545ed26e5ce802ccbc9c5b7485c70d78
BLAKE2b-256 c758e33257e8b2efe53fa1384165049faca16aaaf1d461a10e0c5e9ab5035c6c

See more details on using hashes here.

File details

Details for the file commit_genie-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: commit_genie-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for commit_genie-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66bd4fe45d12a544ff470ff001f74c6d985d58addd3d00b04b513828f1d606a4
MD5 6b3d23d9f30616e7e215ce27a67133dc
BLAKE2b-256 54dd3bbaaa9a4d07c092605715afe70f01231f4523987819b4d5292480429022

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