guanguans/ai-commit 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

guanguans/ai-commit

Composer 安装命令:

composer create-project guanguans/ai-commit

包简介

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

README 文档

README

ai-commit-vhs

ENGLISH | 日本語 | 简体中文 | 繁體中文

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

Ask DeepWiki tests check & fix styling codecov Latest Stable Version GitHub release (latest by date) Total Downloads License

Support

Requirement

  • PHP >= 8.2

Installation

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

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

Usage

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.                                                                     
                                                                                                                                                                                                                                                                                                                                                                                                      

List commands

details
╰─ ./ai-commit list                                                     ─╯

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

  1.2.5

  USAGE: ai-commit <command> [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

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

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

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

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

Command help

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

Usage:
  commit [options] [--] [<path>]

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

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

guanguans/ai-commit 适用场景与选型建议

guanguans/ai-commit 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 31.45k 次下载、GitHub Stars 达 393, 最近一次更新时间为 2023 年 02 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「cli」 「git」 「github」 「model」 「diff」 「chat」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 guanguans/ai-commit 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 guanguans/ai-commit 我们能提供哪些服务?
定制开发 / 二次开发

基于 guanguans/ai-commit 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 31.45k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 393
  • 点击次数: 35
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

  • Stars: 393
  • Watchers: 3
  • Forks: 22
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-03