PHPackages                             guanguans/ai-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. [CLI &amp; Console](/categories/cli)
4. /
5. guanguans/ai-commit

ActiveProject[CLI &amp; Console](/categories/cli)

guanguans/ai-commit
===================

Automagically generate conventional git commit message with AI. - 使用 AI 自动生成约定式 git 提交信息。

1.15.5(1y ago)39231.2k↑26.9%2210MITPHPPHP &gt;=7.3CI passing

Since Feb 3Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/guanguans/ai-commit)[ Packagist](https://packagist.org/packages/guanguans/ai-commit)[ Docs](https://github.com/guanguans/ai-commit)[ Fund](https://www.guanguans.cn/images/wechat.jpeg)[ RSS](/packages/guanguans-ai-commit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (106)Used By (10)

ai-commit
=========

[](#ai-commit)

[![ai-commit-vhs](resources/docs/ai-commit-vhs.gif)](resources/docs/ai-commit-vhs.gif)

[ENGLISH](README.md) | [日本語](README-ja.md) | [简体中文](README-zh_CN.md) | [繁體中文](README-zh_TW.md)

> Automagically generate conventional git commit message with AI. - 使用 AI 自动生成约定式 git 提交信息。

[![Ask DeepWiki](https://camo.githubusercontent.com/0f5ae213ac378635adeb5d7f13cef055ad2f7d9a47b36de7b1c67dbe09f609ca/68747470733a2f2f6465657077696b692e636f6d2f62616467652e737667)](https://deepwiki.com/guanguans/ai-commit)[![tests](https://github.com/guanguans/ai-commit/workflows/tests/badge.svg)](https://github.com/guanguans/ai-commit/actions)[![check & fix styling](https://github.com/guanguans/ai-commit/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/guanguans/ai-commit/actions)[![codecov](https://camo.githubusercontent.com/ce5f3c0e5878b28bcdeede6e8bb3f2c7a2b648ef5944c86bc3ea29e4dbd5bc65/68747470733a2f2f636f6465636f762e696f2f67682f6775616e6775616e732f61692d636f6d6d69742f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d55524746415753365334)](https://codecov.io/gh/guanguans/ai-commit)[![Latest Stable Version](https://camo.githubusercontent.com/e5fd2a642e3570df33cc78d75e01727aeef2e8444f3505342ac53d21e087bf37/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f61692d636f6d6d69742f76)](https://packagist.org/packages/guanguans/ai-commit)[![GitHub release (latest by date)](https://camo.githubusercontent.com/97d259b51340aca2db0d2dc39cc87623ab43639490c35bbae84a90dbf189d413/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6775616e6775616e732f61692d636f6d6d6974)](https://github.com/guanguans/ai-commit/releases/latest)[![Total Downloads](https://camo.githubusercontent.com/2108d5bdafa787932fad65315c3cc943bc3740fda771f6216cc12bc791ab780b/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f61692d636f6d6d69742f646f776e6c6f616473)](https://packagist.org/packages/guanguans/ai-commit)[![License](https://camo.githubusercontent.com/3524bbc21d0e7e7145c2f2f09c2d947aa7cadb1ea6210bc2d4f050e49c892e78/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f61692d636f6d6d69742f6c6963656e7365)](https://packagist.org/packages/guanguans/ai-commit)

Support
-------

[](#support)

- [Bito CLI](https://github.com/gitbito/CLI)
- [ERNIE-Bot-turbo](https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Nlks5zkzu#ernie-bot-turbo)
- [ERNIE-Bot](https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Nlks5zkzu#ernie-bot)
- [GitHub Copilot CLI](https://github.com/github/gh-copilot)
- [GitHub Models CLI](https://github.com/github/gh-models)
- [Moonshot](https://platform.moonshot.cn/docs/api-reference)
- [OpenAI Chat](https://platform.openai.com/docs/api-reference/chat)
- [OpenAI](https://platform.openai.com/docs/api-reference/completions)
- ...

Requirement
-----------

[](#requirement)

- PHP &gt;= 8.2

Installation
------------

[](#installation)

### Download the [ai-commit](./builds/ai-commit) file

[](#download-the-ai-commit-file)

```
curl 'https://raw.githubusercontent.com/guanguans/ai-commit/main/builds/ai-commit' -o ai-commit -#
chmod +x ai-commit
```

### Install via Composer

[](#install-via-composer)

```
composer global require guanguans/ai-commit --dev -v # global
composer require guanguans/ai-commit --dev -v # local
```

Usage
-----

[](#usage)

### Quick start

[](#quick-start)

details```
./ai-commit config set generators.bito_cli.binary bito-cli-binary... --global # Config Bito CLI binary(Optional)
./ai-commit config set generators.ernie_bot.api_key api-key... --global # Config Ernie API key
./ai-commit config set generators.ernie_bot_turbo.api_key api-key... --global # Config Ernie API key
./ai-commit config set generators.github_copilot_cli.binary gh-cli-binary... --global # Config Github CLI binary(Optional)
./ai-commit config set generators.github_models_cli.binary gh-cli-binary... --global # Config Github CLI binary(Optional)
./ai-commit config set generators.moonshot.api_key sk-... --global # Config Moonshot API key
./ai-commit config set generators.openai.api_key sk-... --global # Config OpenAI API key
./ai-commit config set generators.openai_chat.api_key sk-... --global # Config OpenAI API key

./ai-commit config set generator openai_chat --global # Config default generator(Optional)
./ai-commit commit # Generate and commit message using the default generator
./ai-commit commit --generator=github_copilot_cli # Generate and commit message using the specified generator
```

```
╰─ ./ai-commit commit --generator=bito_cli --no-edit --no-verify --ansi                                                                                                      ─╯
1. Generating commit message: generating...

 Please choose commit type [Automatically generate commit type]:
  [auto    ] Automatically generate commit type
  [feat    ] A new feature
  [fix     ] A bug fix
  [docs    ] Documentation only changes
  [style   ] Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  [refactor] A code change that neither fixes a bug nor adds a feature
  [perf    ] A code change that improves performance
  [test    ] Adding missing tests or correcting existing tests
  [build   ] Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  [ci      ] Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  [chore   ] Other changes that don't modify src or test files
  [revert  ] Reverts a previous commit
 > chore

  RUN  'bito'
  ERR  Model in use: BASIC
  ERR
  ERR
  OUT  {
  OUT      "subject": "chore(ai-commit): update tape and gif resources",
  OUT      "body": "- Adjusted width and height settings in ai-commit.tape\n- Changed commit command generator from openai_chat to bito_cli\n- Updated ai-commit-vhs.gif file with new binary data"
  OUT  }
  OUT
  OUT
  RES  Command ran successfully
1. Generating commit message: ✔

2. Confirming commit message: confirming...
+-------------------------------------------------+-----------------------------------------------------------------+
| subject                                         | body                                                            |
+-------------------------------------------------+-----------------------------------------------------------------+
| chore(ai-commit): update tape and gif resources | - Adjusted width and height settings in ai-commit.tape          |
|                                                 | - Changed commit command generator from openai_chat to bito_cli |
|                                                 | - Updated ai-commit-vhs.gif file with new binary data           |
+-------------------------------------------------+-----------------------------------------------------------------+

 Do you want to commit this message? (yes/no) [yes]:
 >

2. Confirming commit message: ✔

3. Committing message: committing...

3. Committing message: ✔

 [OK] Successfully generated and committed message.

```

[![](resources/docs/ai-commit-vhs.gif)](resources/docs/ai-commit-vhs.gif)

### List commands

[](#list-commands)

details```
╰─ ./ai-commit list                                                     ─╯

          _____    _____                          _ _
    /\   |_   _|  / ____|                        (_) |
   /  \    | |   | |     ___  _ __ ___  _ __ ___  _| |_
  / /\ \   | |   | |    / _ \| '_ ` _ \| '_ ` _ \| | __|
 / ____ \ _| |_  | |___| (_) | | | | | | | | | | | | |_
/_/    \_\_____|  \_____\___/|_| |_| |_|_| |_| |_|_|\__|

  1.2.5

  USAGE: ai-commit  [options] [arguments]

  commit      Automagically generate conventional commit message with AI.
  completion  Dump the shell completion script
  config      Manage config options.
  self-update Allows to self-update a build application
  thanks      Thanks for using this tool.
```

### Operate config

[](#operate-config)

details```
./ai-commit config [set, get, unset, reset, list, edit] key value --global

./ai-commit config set key value
./ai-commit config get key
./ai-commit config unset key
./ai-commit config reset key
./ai-commit config list
./ai-commit config edit
```

### Self update

[](#self-update)

details```
╰─ ./ai-commit self-update                                        ─╯

Checking for a new version...
=============================

 [OK] Updated from version 1.2.4 to v1.2.5.

```

### Command help

[](#command-help)

details```
╰─ ./ai-commit commit --help                                                                                                                               ─╯
Description:
  Automagically generate conventional commit message with AI.

Usage:
  commit [options] [--] []

Arguments:
  path                                   The working directory [default: "/Users/yaozm/Documents/develop/ai-commit"]

Options:
      --commit-options[=COMMIT-OPTIONS]  Append options for the `git commit` command [default: ["--edit"]] (multiple values allowed)
      --diff-options[=DIFF-OPTIONS]      Append options for the `git diff` command [default: [":!*-lock.json",":!*.lock",":!*.sum"]] (multiple values allowed)
  -g, --generator=GENERATOR              Specify generator name [default: "openai_chat"]
  -p, --prompt=PROMPT                    Specify prompt name of message generated [default: "conventional"]
      --no-edit                          Enable or disable git commit `--no-edit` option
      --no-verify                        Enable or disable git commit `--no-verify` option
  -c, --config[=CONFIG]                  Specify config file
      --retry-times=RETRY-TIMES          Specify times of retry [default: 3]
      --retry-sleep=RETRY-SLEEP          Specify sleep milliseconds of retry [default: 200]
      --dry-run                          Only generate message without commit
      --diff[=DIFF]                      Specify diff content
  -h, --help                             Display help for the given command. When no command is given display help for the list command
  -q, --quiet                            Do not output any message
  -V, --version                          Display this application version
      --ansi|--no-ansi                   Force (or disable --no-ansi) ANSI output
  -n, --no-interaction                   Do not ask any interactive question
      --env[=ENV]                        The environment the command should run under
  -v|vv|vvv, --verbose                   Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [guanguans](https://github.com/guanguans)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance72

Regular maintenance activity

Popularity48

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.2% 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 ~8 days

Recently: every ~48 days

Total

103

Last Release

366d ago

Major Versions

v0.5.0 → v1.0.02023-02-09

PHP version history (2 changes)v0.1.0PHP &gt;=7.2.5

v1.2.0PHP &gt;=7.3

### Community

Maintainers

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

---

Top Contributors

[![guanguans](https://avatars.githubusercontent.com/u/22309277?v=4)](https://github.com/guanguans "guanguans (497 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (244 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (219 commits)")[![ImgBotApp](https://avatars.githubusercontent.com/u/31427850?v=4)](https://github.com/ImgBotApp "ImgBotApp (4 commits)")[![samarth29jc](https://avatars.githubusercontent.com/u/139863510?v=4)](https://github.com/samarth29jc "samarth29jc (3 commits)")[![eltociear](https://avatars.githubusercontent.com/u/22633385?v=4)](https://github.com/eltociear "eltociear (1 commits)")[![PrathameshSPawar](https://avatars.githubusercontent.com/u/163292716?v=4)](https://github.com/PrathameshSPawar "PrathameshSPawar (1 commits)")[![sravan1946](https://avatars.githubusercontent.com/u/57430307?v=4)](https://github.com/sravan1946 "sravan1946 (1 commits)")

---

Tags

aibitochangelogchatchatgptcommitcommit-messagecommitizencommitlintconventionalconventional-commitcopilotgitgit-diffgithubgptkeepachangelogmodelmodelsopenaiclidiffaimodelopenaigithubghgitmodelsbotchatcommitcommit messagecopilotgptChatGptchangelogkeepachangelogconventionalconventional-commitgit differniecommitlintcommitizenbitokimimoonshotgh-models

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[marcocesarato/php-conventional-changelog

Generate changelogs and release notes from a project's commit messages and metadata and automate versioning with semver.org and conventionalcommits.org

2511.3M109](/packages/marcocesarato-php-conventional-changelog)[automattic/jetpack-changelogger

Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.

106.7M146](/packages/automattic-jetpack-changelogger)[churchtools/changelogger

CLI Tool for creating consistent and committable changelog entries.

3415.3k1](/packages/churchtools-changelogger)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)[salehhashemi/laravel-intelli-git

An intelligent Git helper package for Laravel applications. It utilizes OpenAI's GPT to analyze your Git repository, providing features such as automatic generation of commit messages based on staged changes.

131.5k](/packages/salehhashemi-laravel-intelli-git)

PHPackages © 2026

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