Skip to main content

AI-powered Conventional Commit message generator using your staged changes

Project description

🚀 Komet

AI-Powered Conventional Commit Message Generator

Komet is a smart CLI tool that leverages Groq's LLM API to automatically generate professional, Conventional Commits formatted commit messages from your staged git changes. Say goodbye to bland commit messages and hello to consistent, meaningful version control history.

Python Poetry Groq


✨ Features

  • 🤖 AI-Powered Analysis: Uses Groq's fast LLM (Llama 3.3 70B) to understand your code changes
  • 📝 Conventional Commits: Automatically follows industry-standard commit message format
  • ⚡ Lightning Fast: Groq's infrastructure provides near-instant responses
  • 🎯 Context-Aware: Analyzes actual git diffs to generate accurate, meaningful messages
  • 🛡️ Safe & Smart: Truncates large diffs, validates git repos, and handles edge cases gracefully
  • 🎨 Beautiful CLI: Built with Typer for a modern, user-friendly command-line experience

🎬 Demo

# Stage your changes
$ git add src/komet/main.py

# Let Komet generate the commit message
$ komet

Suggested commit message:

feat(main): add automatic diff truncation for large changesets

Use it like this:
  git commit -m 'feat(main): add automatic diff truncation for large changesets'

🚀 Installation

Prerequisites

  • Python 3.10 or higher
  • Poetry (Python dependency management)
  • Git repository
  • Groq API key (Get it here)

Install via Poetry

# Clone the repository
git clone https://github.com/ajabrii/Komet.git
cd Komet

# Install dependencies
poetry install

# Set your Groq API key
export GROQ_API_KEY=gq_xxxxxxxxxxxxxxxx

# Run Komet
poetry run komet

Install as Global Command

# Install with pipx (recommended)
pipx install .

# Or install globally with poetry
poetry build
pip install dist/komet-0.1.0-py3-none-any.whl

# Now use it anywhere
komet

📖 Usage

Basic Workflow

  1. Stage your changes as usual:

    git add <files>
    
  2. Run Komet:

    komet
    
  3. Copy and commit with the suggested message:

    git commit -m '<generated-message>'
    

Environment Setup

Komet requires a Groq API key. Set it up once:

# Temporary (current session only)
export GROQ_API_KEY=gq_xxxxxxxxxxxxxxxx

# Permanent (add to ~/.bashrc, ~/.zshrc, or ~/.profile)
echo 'export GROQ_API_KEY=gq_xxxxxxxxxxxxxxxx' >> ~/.bashrc
source ~/.bashrc

🏗️ How It Works

  1. Git Diff Extraction: Komet uses GitPython to read your staged changes (git diff --cached)
  2. Context Preparation: The diff is sent to Groq's LLM with a carefully crafted system prompt
  3. AI Analysis: The LLM analyzes the code changes and generates a Conventional Commit message
  4. Formatted Output: The result is displayed with usage instructions

Conventional Commit Format

Komet generates messages following this structure:

<type>(<optional-scope>): <short-description>

<optional-body>

<optional-footer>

Supported types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert


🛠️ Technology Stack

Technology Purpose
Python 3.10+ Core programming language
Poetry Dependency management and packaging
Typer Modern CLI framework with beautiful output
GitPython Git repository interaction
Groq SDK LLM API integration (Llama 3.3 70B)

📁 Project Structure

Komet/
├── src/
│   └── komet/
│       ├── __init__.py          # Package initialization
│       └── main.py              # Core application logic
├── pyproject.toml               # Poetry configuration & dependencies
└── README.md                    # Project documentation

🔧 Configuration

Model Selection

Komet uses llama-3.3-70b-versatile by default. You can modify main.py to use other Groq models:

  • llama-3.3-70b-versatile - Best quality & speed balance (default)
  • mixtral-8x7b-32768 - Cheaper alternative, still excellent quality

Diff Size Limits

Large diffs are automatically truncated to 15,000 characters to fit within LLM context windows. Adjust in main.py.


🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License

This project is open source and available under the MIT License.


👤 Author

Abdelali Jabri


🙏 Acknowledgments

  • Conventional Commits - For the commit message specification
  • Groq - For providing lightning-fast LLM inference
  • Typer - For the excellent CLI framework

🌟 Why Komet?

In professional software development, clear commit history is crucial for:

  • Code Reviews: Understanding what changed and why
  • Debugging: Using git bisect to find when bugs were introduced
  • Documentation: Auto-generating changelogs from commits
  • Team Collaboration: Maintaining consistency across team members

Komet automates best practices, ensuring every commit tells a clear story.


Made with ❤️ by Abdelali Jabri

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

ikomet-0.1.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

ikomet-0.1.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file ikomet-0.1.1.tar.gz.

File metadata

  • Download URL: ikomet-0.1.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.11 Linux/6.18.3+kali+1-amd64

File hashes

Hashes for ikomet-0.1.1.tar.gz
Algorithm Hash digest
SHA256 07b9d5cab6db29ddee3710faefedda989eba3cd17ca28bf82e956c43c017160b
MD5 372eb4b18ca3d74dfb498a574e87dd3b
BLAKE2b-256 dfa2cfdd1cbc6457ea49f316f1c0f53da672a69eb17f2d375f12f258dc655a78

See more details on using hashes here.

File details

Details for the file ikomet-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ikomet-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.11 Linux/6.18.3+kali+1-amd64

File hashes

Hashes for ikomet-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c5a691e3c6d1da5a9b387019ccd9fa016703ce011dd4c739c4b455d55d4e5df6
MD5 01414f60334ac487c7af1f4a03a24d1b
BLAKE2b-256 20084eb46402898de033d2788d2eb3389f5e8fbb59ac9318be13071f54afeebf

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