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.

PyPI 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
  • Git repository
  • Groq API key (Get it here)

Quick Install from PyPI (Recommended)

Install globally using pipx (recommended for CLI tools):

# Install pipx if you don't have it
python3 -m pip install --user pipx
python3 -m pipx ensurepath

# Install ikomet
pipx install ikomet

# Now use it anywhere!
komet

Or install with pip:

pip install ikomet

Install from Source

For development or contributing:

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

# Install with poetry
poetry install

# Run Komet
poetry run 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:

    
    

Set it up once:

# Linux/macOS - Temporary (current session only)
export GROQ_API_KEY=gq_xxxxxxxxxxxxxxxx

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

# Windows (PowerShell)
$env:GROQ_API_KEY="gq_xxxxxxxxxxxxxxxx"

# Windows - Permanent (System Environment Variables)
setx GROQ_API_KEY "gq_xxxxxxxxxxxxxxxx"
# 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.2.tar.gz (6.1 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.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ikomet-0.1.2.tar.gz
  • Upload date:
  • Size: 6.1 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.2.tar.gz
Algorithm Hash digest
SHA256 a0c3c361dfe083bf487e53dd59ff22737eef83b23c748b394a60364ec6c19e06
MD5 7ece8aeec0ea94531f731dac1b79ba67
BLAKE2b-256 cbd90c8056ff11a2a4ebc4206dc13f20d8ea55e48142bda9f184922f95126f64

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ikomet-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ba23374dfe30797b7bfb27ceb114ff8f5ebbf059f2a60f9c6245aca32b1d4d8f
MD5 c2e7b830e7b3ba7ddd27246fcd149dc3
BLAKE2b-256 62aabfdf8e2e625dfb5424a1d23f6aeae0af6fdb7010b2ccccfd9e0dc25a9567

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