Download the PHP package jesse-bos/openai-commit-messages without Composer
On this page you can find all versions of the php package jesse-bos/openai-commit-messages. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jesse-bos/openai-commit-messages
More information about jesse-bos/openai-commit-messages
Files in jesse-bos/openai-commit-messages
Package openai-commit-messages
Short Description A Laravel package that generates AI-powered commit messages using OpenAI
License MIT
Homepage https://github.com/jesse-bos/openai-commit-messages
Informations about the package openai-commit-messages
OpenAI Commit Messages - AI-Generated Git Commit Messages
OpenAI Commit Messages is a Laravel package that generates meaningful commit messages using OpenAI based on your git changes. It first checks for staged changes, and if none are found, analyzes unstaged changes. Just run one command and get a suggested commit message!
Installation
Step 1: Install the Package
This automatically installs the required OpenAI Laravel package as well.
Step 2: Publish OpenAI Configuration
Step 3: Add your OpenAI API Key
- Get an API key from OpenAI's website
- Add it to your
.envfile:
Step 4: Optionally configure the Package
If you want to customize the OpenAI model, publish the package config:
Prerequisites
- PHP 8.3+
- Laravel 11.0+ or 12.0+
- OpenAI API key with sufficient credits
Usage
Verify your setup (recommended first time)
After installation, verify that everything is configured correctly by running the command. The package will automatically check:
- ✓ OpenAI API key is set
- ✓ OpenAI configuration is published
- ✓ You're in a git repository
- ✓ Model configuration
Generate commit messages
After making changes in your git repository, simply run:
The package will automatically:
- First check for staged changes (files added with
git addor staged via Tower, GitHub Desktop, etc.) - If no staged changes found, it will analyze unstaged changes
- Generate a commit message based on the found changes using OpenAI
The tool works seamlessly with any git workflow:
- Command line:
git add .thenphp artisan openai:commit-message - Tower/GitHub Desktop: Stage files in the GUI, then run
php artisan openai:commit-message - Quick preview: Just run
php artisan openai:commit-messageto see a message for unstaged changes
After getting the suggested message, create your commit:
Configuration
You can configure the package by publishing and editing the config file:
Available Configuration Options
Environment Variables
You can also configure the OpenAI model using an environment variable:
Testing
Credits
- Jesse Bos
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of openai-commit-messages with dependencies
illuminate/contracts Version ^11.0||^12.0
openai-php/laravel Version ^0.13.0
spatie/laravel-package-tools Version ^1.16