PHPackages                             ysocode/commit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ysocode/commit

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ysocode/commit
==============

Generate your conventional commit with AI

v3.0.1(1y ago)021MITPHPPHP ^8.3

Since Mar 2Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/ysocode/commit)[ Packagist](https://packagist.org/packages/ysocode/commit)[ RSS](/packages/ysocode-commit/feed)WikiDiscussions 3.x Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (17)Used By (0)

Commit - Automate Your Conventional Commit Messages With AI
===========================================================

[](#commit---automate-your-conventional-commit-messages-with-ai)

[![Latest Version on Packagist](https://camo.githubusercontent.com/26b155e050697426bc1fd65f19345860a66dd1edb9f65e032c6e97578e2c0053/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79736f636f64652f636f6d6d69742e7376673f7374796c653d666c6174)](https://packagist.org/packages/ysocode/commit)[![Downloads on Packagist](https://camo.githubusercontent.com/3e42b3b1a18ed656bd1f302f3bde242abca004bd871d775898cbbfd56d8366a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f79736f636f64652f636f6d6d69742e7376673f7374796c653d666c6174)](https://packagist.org/packages/ysocode/commit)[![License](https://camo.githubusercontent.com/b0384bef722b8263917d6bf04dbbecef88223c52c21ecbd678529e810c7ad9e4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f79736f636f64652f636f6d6d6974)](https://packagist.org/packages/ysocode/commit)

Introduction
------------

[](#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
----------------------

[](#official-documentation)

##### Install Commit using Composer:

[](#install-commit-using-composer)

```
composer global require ysocode/commit
```

##### Initialize Configuration

[](#initialize-configuration)

To initialize the necessary configuration files:

```
commit init
```

#### Manage AI Provider

[](#manage-ai-provider)

##### List all enabled AI providers

[](#list-all-enabled-ai-providers)

To display all enabled AI providers:

```
commit ai:provider --list
```

##### Set the default AI provider

[](#set-the-default-ai-provider)

To define which AI provider should be used as default:

```
commit ai:provider sourcegraph
```

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

[](#get-the-current-default-ai-provider)

To display the current AI provider:

```
commit ai:provider --get
```

#### Managing API keys

[](#managing-api-keys)

##### Set your API key for a specific AI provider

[](#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:

```
commit ai:api-key --provider=openai YOUR_API_KEY
```

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

[](#get-the-current-api-key-for-a-specific-ai-provider)

Display the currently stored API key for the specified AI provider:

```
commit ai:api-key --get --provider=openai
```

If you don't specify a provider, the default AI provider will be selected automatically.

##### Sourcegraph Provider

[](#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:

```
npm install -g @sourcegraph/cody
```

For a comprehensive guide on Cody CLI installation and configuration, visit the [Cody CLI documentation](https://sourcegraph.com/docs/cody/clients/install-cli).

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:

```
commit ai:api-key --provider=sourcegraph YOUR_API_KEY
```

The key you set here corresponds directly to the SRC\_ACCESS\_TOKEN used by the Cody CLI.

#### Main functionality

[](#main-functionality)

##### Generate a Commit Message

[](#generate-a-commit-message)

To automatically generate a Conventional Commit message based on the current `staged changes`:

```
commit generate
```

This will display the generated commit message for your confirmation before finalizing the commit.

##### Using a Custom Diff

[](#using-a-custom-diff)

You can provide a custom diff instead of using the automatically detected staged changes:

```
commit generate YOUR_CUSTOM_DIFF
```

##### Using options to customize the commit

[](#using-options-to-customize-the-commit)

Use the `--provider` option to select the AI provider:

```
commit generate --provider=openai
```

Use the `--lang` option to specify the language for the commit message:

```
commit generate --lang=pt_BR
```

Enabled languages:

- `en_US` for English (United States)
- `pt_BR` for Portuguese (Brazil)
- `es_ES` for Spanish (Spain)

License
-------

[](#license)

Commit is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance64

Regular maintenance activity

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Recently: every ~79 days

Total

17

Last Release

119d ago

Major Versions

v1.0.6 → v2.0.02025-03-04

v2.1.4 → v3.0.02025-03-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/a186bb75f7d3e0d634cd5f1e3f59a8bcf3c08523b8805ed5952ee0358219f7d5?d=identicon)[ysocode](/maintainers/ysocode)

---

Top Contributors

[![yusadeol](https://avatars.githubusercontent.com/u/54549125?v=4)](https://github.com/yusadeol "yusadeol (124 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ysocode-commit/health.svg)

```
[![Health](https://phpackages.com/badges/ysocode-commit/health.svg)](https://phpackages.com/packages/ysocode-commit)
```

###  Alternatives

[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)[shivas/versioning-bundle

Symfony application versioning, simple console command to manage version (with providers e.g. git tag) of your application using Semantic Versioning 2.0.0 recommendations

1121.2M1](/packages/shivas-versioning-bundle)[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)[overtrue/php-opencc

中文简繁转换，支持词汇级别的转换、异体字转换和地区习惯用词转换（中国大陆、台湾、香港、日本新字体）。基于 \[BYVoid/OpenCC\](https://github.com/BYVoid/OpenCC) 数据实现。

12130.7k](/packages/overtrue-php-opencc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
