标题: 用 Claude Code 开发了一个自动生成 Git commit message 的工具 catmit
各位好,最近一直在使用 Claude Code ,用它完成了一个新工具 catmit 的开发。
这个工具解决的是一个常见痛点:编写高质量的 commit message 。
为什么不用 aicommit 或者 Cursor 或者 Claude Code 本身,因为 aicommit 只支持 OpenAI 、Cursor 已经累觉不爱,Claude Code 需要省点 token 用来干真正的活儿。
catmit 的工作流程: 分析代码差异 → 理解变更上下文 → 生成符合 conventional commit 规范的提交信息 → 预览确认 → 提交
对比示例:
传统写法:"修复认证 bug"
catmit 生成:
fix(auth): 解决 token 验证的竞态条件问题
- 添加互斥锁防止并发刷新 token
- 更新过期 token 的错误处理逻辑
核心特性:
项目地址: https://github.com/penwyp/catmit
安装方法:
brew tap penwyp/catmit && brew install catmit
go install github.com/penwyp/catmit@latest
欢迎大家试用并提供反馈。
![]() |
1
kkeep 2 天前
claude -p "/commit-code" 就行了,配置一个 command
|
![]() |
3
zzerd 2 天前
#### 这玩意我一直用 aichat 命令行工具,配置一个 role 一个 git alias 就行了。用的时候就是 git ai-commit
##### role Library/Application Support/aichat/roles/creage-git-message.md ```markdown --- model: gemini:gemini-2.5-flash temperature: 0 --- You are an expert software engineer. Review the provided context and diffs which are about to be committed to a git repo. Review the diffs carefully. Generate a commit message for those changes. The commit message MUST use the imperative tense. The commit message should be structured as follows: <type>: <description> Use these for <type>: fix, feat, build, chore, ci, docs, style, refactor, perf, test Reply with JUST the commit message, without quotes, comments, questions, etc! ```` ##### git alias ```shell [alias] ai-commit = "!f() { git commit -m \"$(git diff | aichat -r create-git-message)\"; }; f" } ``` |
4
maximdx 2 天前
我感觉搞个 subagent 更合适一点?
|