Download the PHP package ysocode/commit without Composer
On this page you can find all versions of the php package ysocode/commit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ysocode/commit
More information about ysocode/commit
Files in ysocode/commit
Package commit
Short Description Generate your conventional commit with AI
License MIT
Informations about the package commit
Commit - Automate your Conventional Commit messages with AI
Introduction
Commit is a PHP package that automates the generation of Conventional Commit messages using AI.
By analyzing your staged changes
, it generates clear and structured commit messages
that strictly follow the Conventional Commits standard.
Official Documentation
Install Commit using Composer:
Initialize Configuration
To initialize the necessary configuration files:
Manage AI Provider
List all enabled AI providers
To display all enabled AI providers:
Set the default AI provider
To define which AI provider should be used as default:
If no provider argument is specified, an interactive prompt will appear, allowing you to select the desired AI provider.
Get the current default AI provider
To display the current AI provider:
Managing API keys
Set your API key for a specific AI provider
Commit allows you to set your API keys for the AI providers you choose. To set your API key for an AI provider, use the following commands:
If you don't specify a provider, an interactive prompt will appear with a list of enabled AIs for you to select from.
Get the current API key for a specific AI provider
Display the currently stored API key for the specified AI provider:
If you don't specify a provider, the default AI provider will be selected automatically.
Sourcegraph Provider
Sourcegraph is available as an AI provider in our list of supported services. To use Sourcegraph, you must first install the Cody CLI:
For a comprehensive guide on Cody CLI installation and configuration, visit the Cody CLI documentation.
Now that you have the Cody CLI available, you can follow the same process as other AI providers by setting your key, and ysocode/commit will handle the rest for you:
The key you set here corresponds directly to the SRC_ACCESS_TOKEN used by the Cody CLI.
Main functionality
Generate a Commit Message
To automatically generate a Conventional Commit message based on the current staged changes
:
This will display the generated commit message for your confirmation before finalizing the commit.
Using a Custom Diff
You can provide a custom diff instead of using the automatically detected staged changes:
Using options to customize the commit
Use the --provider
option to select the AI provider:
Use the --lang
option to specify the language for the commit message:
Enabled languages:
en_US
for English (United States)pt_BR
for Portuguese (Brazil)es_ES
for Spanish (Spain)
License
Commit is open-sourced software licensed under the MIT license.
All versions of commit with dependencies
symfony/console Version ^7.2
symfony/process Version ^7.2
symfony/http-client Version ^7.2