ai-commit - 让 AI 为你自动生成 conventional 格式的提交信息

ai-commit - 让 AI 为你自动生成 conventional 格式的提交信息

源码

github.com/guanguans/ai-commit

功能

  • 默认生成 conventional 格式的提交信息
  • 可自定义生成信息的 AI 驱动(目前仅支持 Open AI)
  • 可自定义生成待选提交信息的数量
  • 可自定义生成信息的提示模板

安装

直接下载 ai-commit 文件

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

通过 Composer 安装

# 全局
composer global require guanguans/ai-commit --dev -v

# 本地
composer require guanguans/ai-commit --dev -v

使用

配置 OpenAI API key

./ai-commit config set generators.openai.api_key sk-... --global

生成且提交信息

./ai-commit commit
╰─ ./ai-commit commit                                                                                  ─╯
1. Checking run environment: ✔
2. Generating commit messages: generating...

[
    {
        "id": 1,
        "subject": "Docs(README): Configure OpenAI API key",
        "body": "- Update README-zh_CN.md\n- Update README.md\n- Explain how to configure OpenAI API key"
    },
    {
        "id": 2,
        "subject": "Install(Composer): Add global and local install instructions",
        "body": "- Update README.md\n- Add instructions for global and local install via Composer"
    },
    {
        "id": 3,
        "subject": "Usage(Commit Messages): Add best practices",
        "body": "- Update README.md\n- Add best practices for writing commit messages"
    }
]

2. Generating commit messages: ✔
3. Choosing commit message: choosing...

 Please choice a commit message:
  [1] Docs(README): Configure OpenAI API key
  [2] Install(Composer): Add global and local install instructions
  [3] Usage(Commit Messages): Add best practices
 > 
本作品采用《CC 协议》,转载必须注明作者和本文链接
No practice, no gain in one's wit. 我的 Gitub
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 6

等他进度走完我 commit 都写完了..[😢]

1年前 评论
guanguans (楼主) 1年前
GeorgeKing 1年前
guanguans (楼主) 1年前
游离不2

建议用 Hyperf 的 hyperf/box 打包,把 PHP 一起打进去,这样就没有 PHP 版本的问题了。

1年前 评论
guanguans (楼主) 1年前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!
未填写
文章
56
粉丝
126
喜欢
971
收藏
1333
排名:46
访问:15.3 万
私信
所有博文
社区赞助商