项目主页: https://github.com/mingeme/aicommit
开发初衷是希望有个工具能一键生成 git 的提交信息,一开始是在 gpt 网页对话,复制粘贴,略显麻烦。github 关键字一搜 aicommit 也有很多项目,都能用,基于能自己造轮子就自己造轮子的心态,还是忍不住又复刻一遍,整个项目 95% 都通过 windsurf 生成,整体目标是尽量保证简单方便使用。
brew install mingeme/tap/aicommit
$ # 使用阿里千问大模型,可以在百练申请 api 免费试用 180 天(不是广告),大家可以先尝试用我的体验一下
$ aicommit auth add qwen sk-e6234945f70d48a6b1f1b5934ba6fd68
$ git add .
$ aicommit
$ aicommit prompt init # 初始化配置文件在当前目录 .aicommit.yml
$ aicommit prompt init -g # 初始化配置文件在全局目录 ~/.config/aicommit/.aicommit.yml
这里贴出我的配置
.aicommit.yml
prompt:
system: |
You are a helpful assistant that generates clear and concise git commit messages. Follow conventional commits format. Disable markdown in the response.
user: |
Please generate a commit message for the following git diff:
{{diff}}
# 支持忽略自定义文件的变更
exclude:
- 'package-lock.json'
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.