Skip to main content

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_KEY environment variable or configured in jbussdieker)

🎯 Usage

Basic Usage

  1. Stage your changes:

    git add .
    
  2. 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 features
  • fix: Bug fixes
  • docs: Documentation changes
  • style: Code style changes (formatting, etc.)
  • refactor: Code refactoring
  • test: Adding or updating tests
  • chore: Maintenance tasks
  • perf: Performance improvements
  • ci: CI/CD changes
  • build: Build system changes
  • revert: Reverting previous commits

🔍 How It Works

  1. Analyzes Staged Changes: Reads git diff --cached to understand what's being committed
  2. Gathers Context: Collects project information (branch, recent commits, project type)
  3. Generates Message: Uses OpenAI GPT-4 to create a conventional commit message
  4. Interactive Review: Opens your default editor for final review and editing
  5. Creates Commit: Executes git commit with 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

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

jbussdieker_commit-0.5.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jbussdieker_commit-0.5.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file jbussdieker_commit-0.5.0.tar.gz.

File metadata

  • Download URL: jbussdieker_commit-0.5.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for jbussdieker_commit-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a7962c3d2ada5ea6755b968590cde2588eb18362c26106c6575ad50a0c8518c5
MD5 362893ac58e319b1f472237c39f2c569
BLAKE2b-256 854502ac2e43f5d3ad15aabb670e9e8a7c3ee3920b50cd266f352f9e2f69b77e

See more details on using hashes here.

File details

Details for the file jbussdieker_commit-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jbussdieker_commit-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1926a6098ff3937fcd3280345a70d6784db7b624b64ff4884364827804a16015
MD5 38a0c7a89a291a2b5141e6e6f3696c5e
BLAKE2b-256 1bdf7990c0a94e973e822f913c111f21a0215e4756a99b267f5f49a076aafe50

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