jbussdieker-commit
A modern Python development toolkit plugin for generating conventional commit messages using AI. This plugin integrates with the jbussdieker CLI framework to provide intelligent, context-aware commit message generation.
🚀 Features
- AI-Powered Commit Messages: Uses OpenAI's GPT-4 to generate conventional commit messages
- Context-Aware: Analyzes staged changes and project context for better commit messages
- Conventional Commits: Follows the Conventional Commits specification
- Interactive Editing: Opens your default editor to review and modify generated messages
- Dry Run Mode: Preview generated commit messages without creating commits
- Multi-Project Support: Automatically detects project type (Python, Node.js, Rust, etc.)
📦 Installation
pip install jbussdieker-commit --upgrade
🔧 Prerequisites
- Python 3.9 or higher
- Git repository with staged changes
- OpenAI API key (set as
OPENAI_API_KEYenvironment variable or configured in jbussdieker)
🎯 Usage
Basic Usage
-
Stage your changes:
git add .
-
Generate and create a commit:
jbussdieker commit
Dry Run Mode
Preview the generated commit message without creating a commit:
jbussdieker commit --dry-run
Configuration
The plugin uses your jbussdieker configuration for the OpenAI API key. You can set it in your config file or use the OPENAI_API_KEY environment variable.
📋 Generated Commit Format
The plugin generates commits following the conventional commit format:
<type>(<scope>): <description>
- <change 1>
- <change 2>
- <change 3>
Supported Types
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasksperf: Performance improvementsci: CI/CD changesbuild: Build system changesrevert: Reverting previous commits
🔍 How It Works
- Analyzes Staged Changes: Reads
git diff --cachedto understand what's being committed - Gathers Context: Collects project information (branch, recent commits, project type)
- Generates Message: Uses OpenAI GPT-4 to create a conventional commit message
- Interactive Review: Opens your default editor for final review and editing
- Creates Commit: Executes
git commitwith the final message
🛠️ Development
This plugin is part of the jbussdieker ecosystem. It integrates seamlessly with the jbussdieker CLI framework.
Project Structure
src/jbussdieker/commit/
├── __init__.py
├── cli.py # CLI interface and argument parsing
└── util.py # Core functionality
📝 License
This project is licensed under MIT.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📚 Related
- jbussdieker - The main CLI framework
- Conventional Commits - Commit message specification
Metadata
Release files for jbussdieker-commit 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jbussdieker_commit-0.5.1.tar.gz | 11.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jbussdieker_commit-0.5.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.6 kB
Release files / jbussdieker_commit-0.5.1.tar.gz
| Download URL | jbussdieker_commit-0.5.1.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6b2fcea4eb9bca989bd86504b8c3fa296778df0767b1f7daf8a81240066afb75
|
|
BLAKE2b-256 checksum How to use checksums |
1ca83e37f38c85ce009e3a7d1f83dd506138c5d12fa19875fe5b2bca241f5207
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / jbussdieker_commit-0.5.1-py3-none-any.whl
| Download URL | jbussdieker_commit-0.5.1-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0ac35f57ce40692e47d59fe7065ae5c69859d9a14ad7e2a774eb2bde514c4710
|
|
BLAKE2b-256 checksum How to use checksums |
822113dc7dd12cd55708c0142eeda3fda0dc3a3391aaadc3ebd0ac7ccd99f21b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|