每次写 commit message 都很纠结?写得太随意又不规范?
做了一个命令行工具 ai-commit,自动分析 git diff,调用大模型生成 Conventional Commits 格式的提交信息。
$ git add .
$ ai-commit
正在生成 commit message...
──────────────────────────────────────────────────
feat(auth): add JWT token refresh mechanism
──────────────────────────────────────────────────
? 请选择操作:
❯ 确认提交
编辑后提交
重新生成
取消
curl -fsSL https://raw.githubusercontent.com/lifedever/ai-commit/main/install.sh | bash
需要 Node.js >= 18 ,一行搞定。
只需要一个环境变量,配置你的 API Key:
# DeepSeek (默认)
export AI_COMMIT_API_KEY="sk-your-key"
# 也支持 OpenAI 、火山引擎、Ollama 等任何 OpenAI 兼容 API
ai-commit -l zh 生成中文 commit messageai-commit --update 更新,ai-commit --uninstall 卸载ai-commit # 交互式生成并提交
ai-commit -y # 跳过确认直接提交
ai-commit -d # 只看生成结果不提交
ai-commit -l zh # 中文 commit message
ai-commit --update # 更新到最新版
GitHub: https://github.com/lifedever/ai-commit
MIT 开源,TypeScript 写的,代码很简单。欢迎 Star 、提 Issue 、PR 。

1
duhbbx1119 1 天前
这个不是直接使用 Claude code 吗
|
2
gefangshuai OP @duhbbx1119 #1 适合外置用
|
3
0x0x 1 天前 via Android
这个场景一年前应该还有些市场,现在已经没人用了吧。
用 cursor 类的 ide ,都自带了 用 Claude Code 等 cli ,写个 skill 就可以了 |
4
ferock PRO idea 各种插件都有这个功能,cc 直接 skill
|
5
passion336699 1 天前
现在写一个 command, 两句话就行了吧...
创建符合 Conventional Commits 规范的 git commit 。 不要添加任何广告, 禁止在提交信息中添加任何广告或推广链接,例如 "Generated with [Claude Code]( https://claude.ai/code)" |
6
wkdwkd2023 23 小时 31 分钟前
cursor 直接写个 skills ,调用的时候还能读取本地的 rules 顺手做个 code review
|
7
ratazzi 22 小时 39 分钟前
https://github.com/ratazzi/git-plan
我已经直接写了个 非交互式的工具让 AI 自动提交 |
8
sn0wdr1am 15 小时 14 分钟前
IDE 自带智能 commit 功能了。
|
9
Moishine 13 小时 55 分钟前
cursor 里面敲一个 commit push ,它自己就完成了
|
10
pill 13 小时 13 分钟前 via iPhone
Viscose 不是自带这玩意儿吗
|
11
AoEiuV020JP 12 小时 56 分钟前
感觉这种方案 AI 会从 diff 中读取到很多不重要的东西, 重心跑偏,总会写上一些没用的信息,
所以我现在直接让 AI 写完代码自己提交,commit log 就写的非常好, |
12
gefangshuai OP @Moishine #9 适合外置用
|
13
gefangshuai OP @sn0wdr1am #8 适合外置用
|