AI-powered Git commit messages
Project description
PyComet 🚀
PyComet is an AI-powered Git commit message generator that helps you create meaningful and consistent commit messages using advanced AI models.
Installation & Usage Options
Recommended: Global Installation with UV
Install PyComet globally with uv (recommended for better dependency management):
uv tool install pycomet-cli
Alternative: Standard Installation (pip)
# Install from PyPI
pip install pycomet-cli
# Or with specific version
pip install pycomet-cli==0.1.2
Quick Run with UV (No Installation)
Use uvx to run PyComet directly without installing:
uvx pycomet-cli
This is equivalent to uv tool run pycomet-cli
After installation (via any method), you can use these commands:
pycomet commit # Generate and create a commit
pycomet-cli commit # Alternative command name
Note: Both command names (
pycometandpycomet-cli) are available and function identically.
Quick Start
Option 1: Install and Run (Recommended)
# Install globally (recommended)
uv tool install pycomet-cli
# Or via pip
pip install pycomet-cli
# Configure your AI provider
pycomet config
# Use in any git repository
git add .
pycomet preview # Preview the message
pycomet commit # Create commit
Option 2: Run from Source
# Clone the repository
git clone https://github.com/jaydoubleu/pycomet.git
cd pycomet
# Install dependencies
uv sync
# Configure your AI provider
uv run pycomet config
# Use PyComet
git add .
uv run pycomet preview # Preview the message
uv run pycomet commit # Create commit
Option 3: Direct Execution (No Clone)
# Run directly without installing
uvx pycomet-cli config
uvx pycomet-cli preview
uvx pycomet-cli commit
After configuration, edit ~/.config/pycomet/config.yaml to add your API key and preferred settings.
Features
- 🤖 Smart Analysis: Analyzes code changes to generate contextual commit messages
- 📝 Conventional Commits: Follows standard commit message format
- 😊 Emoji Support: Automatic emoji inclusion based on change type
- ⚙️ Multiple AI Providers:
- Anthropic Claude
- OpenAI GPT-4
- Google Gemini
- Azure OpenAI
- And more via litellm
- ✏️ Interactive Editing: Review and modify messages before committing
- 🔧 Customizable: Configure prompts, formats, and preferences
- 📊 Usage Tracking: Monitor token usage and costs
- 🚀 Rate Limiting: Automatic handling of API rate limits
Basic Commands
# Create a commit with AI-generated message
uv run pycomet commit
# Preview message without committing
uv run pycomet preview
# Configure settings
uv run pycomet config
Command Options
# Show detailed execution info
uv run pycomet commit --verbose
uv run pycomet preview --verbose
# Control emoji inclusion
uv run pycomet commit --emoji # Force emoji
uv run pycomet commit --no-emoji # Disable emoji
# Control message format
uv run pycomet commit --detailed # Multi-line format
uv run pycomet commit --no-detailed # Single-line format
# Use custom prompt
uv run pycomet commit --prompt "$(cat my-prompt.txt)"
# Specify editor
uv run pycomet commit --editor vim
Configuration
PyComet uses a YAML config file at ~/.config/pycomet/config.yaml. For detailed configuration options and examples for all supported AI providers, see CONFIGS.md.
Basic configuration example:
ai:
provider: anthropic
model: claude-3-sonnet-20240229
api_key: your-api-key
commit:
editor: nvim # Your preferred editor
include_emoji: true
detailed: false # Single-line or multi-line format
Supported AI Providers
Here are some common provider configurations. For a complete list and detailed options, see CONFIGS.md.
Anthropic Claude (Default)
ai:
provider: anthropic
model: claude-3-sonnet-20240229
api_key: your-api-key
OpenAI
ai:
provider: openai
model: gpt-4
api_key: your-openai-key
Google Gemini
ai:
provider: gemini
model: gemini-pro
api_key: your-google-key
Azure OpenAI
ai:
provider: azure
model: gpt-4
api_key: your-azure-key
api_base: your-azure-endpoint
api_version: 2024-02-15-preview
Message Formats
Single-line (Default)
✨ feat(auth): add OAuth2 authentication
Detailed (Multi-line)
✨ feat(auth): implement OAuth2 authentication
Add support for OAuth2 authentication flow
- Add OAuth2 middleware and handlers
- Implement token refresh logic
- Add user session management
Contributing
- Fork the repository
- Create your feature branch
- Make your changes
- Run tests and quality checks
- Submit a pull request
See DEVELOPMENT.md for detailed guidelines.
License
PyComet is licensed under the GNU General Public License v3.0 (GPLv3). See LICENSE for details.
Support
Acknowledgments
- Built with litellm for AI integration
- Uses Click for CLI interface
- Inspired by the opencommit project
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycomet_cli-0.1.2.tar.gz.
File metadata
- Download URL: pycomet_cli-0.1.2.tar.gz
- Upload date:
- Size: 21.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc9d229016db8509b169a4905b5a20ed325e06d529635f5f49fa7bc436b81711
|
|
| MD5 |
52ad004d23982afb12ced6e8add8895e
|
|
| BLAKE2b-256 |
6713c9697f860e194139932e730c64a25e3f0c1881373ae600fee4b385da86e5
|
File details
Details for the file pycomet_cli-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pycomet_cli-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42c2d3e84552bffe5746de4aa32cd2cebc6e4b06646e42fdc40b1bea7d5bf66e
|
|
| MD5 |
9e7d2ca25c63ee243f631a91c1bd4ed1
|
|
| BLAKE2b-256 |
3fe17a29cb42da977d4e0270eb024c2d6347743bcb6e8074c58752d227e7fe6d
|