A modern Python development toolkit.
Project description
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
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
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 jbussdieker_commit-0.4.1.tar.gz.
File metadata
- Download URL: jbussdieker_commit-0.4.1.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5fc44326aaa72505291009359aa2c4280959fc4f3aee91ff5952a2123d77b05
|
|
| MD5 |
74ad9c1546d77f06b4fc0a8863d45d90
|
|
| BLAKE2b-256 |
5a37e7080afdc92f94bcbc8a8ae6f06d24ff4eedd959056e5041acd774b63e3a
|
File details
Details for the file jbussdieker_commit-0.4.1-py3-none-any.whl.
File metadata
- Download URL: jbussdieker_commit-0.4.1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4da1ea7b0928ef328bee9f86a372b4dbdf4c4287e09aef1d0515dec88620422
|
|
| MD5 |
9520604fd36fa02535925ab1a787df7c
|
|
| BLAKE2b-256 |
b1ee3ce53a963d2bc8a27cb0d61c9da0044d05b8059743bc49cfbb7a9988b23c
|