PyComet is an AI-powered Git commit message generator that helps you create meaningful and consistent commit messages using advanced AI models.
Install PyComet globally with uv (recommended for better dependency management):
uv tool install pycomet-cli
# Install from PyPI
pip install pycomet-cli
# Or with specific version
pip install pycomet-cli==0.1.2
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 (
pycomet
andpycomet-cli
) are available and function identically.
# 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
# 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
# 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.
- π€ 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
# 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
# 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
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
Here are some common provider configurations. For a complete list and detailed options, see CONFIGS.md.
ai:
provider: anthropic
model: claude-3-sonnet-20240229
api_key: your-api-key
ai:
provider: openai
model: gpt-4
api_key: your-openai-key
ai:
provider: gemini
model: gemini-pro
api_key: your-google-key
ai:
provider: azure
model: gpt-4
api_key: your-azure-key
api_base: your-azure-endpoint
api_version: 2024-02-15-preview
β¨ feat(auth): add OAuth2 authentication
β¨ feat(auth): implement OAuth2 authentication
Add support for OAuth2 authentication flow
- Add OAuth2 middleware and handlers
- Implement token refresh logic
- Add user session management
- 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.
PyComet is licensed under the GNU General Public License v3.0 (GPLv3). See LICENSE for details.
- Built with litellm for AI integration
- Uses Click for CLI interface
- Inspired by the opencommit project