与人工智能一起

使用 gitmoji 和 Claude Code

1 min read
102 words

安装我们的 gitmoji 插件以便为 Claude Code 生成符合规范的提交。

安装插件

添加 onRuntime 市场并安装插件:

# 添加 onRuntime 市场
/plugin marketplace add https://onruntime.com/plugins

# 安装 gitmoji 插件
/plugin install gitmoji@onruntime

或者直接从菜单中安装:

  1. 在 Claude Code 中运行 /plugin
  2. 进入 发现 标签
  3. 添加市场: https://onruntime.com/plugins
  4. 搜索 "gitmoji" 并安装

使用方法

运行 /commit 命令来创建提交:

/commit
/commit fix the login bug

Claude Code 会分析你的更改并创建遵循 gitmoji 规范的提交。

插件命令

/commit 命令会自动获取你的 git 状态和差异,以生成合适的提交信息。

替代方案:CLAUDE.md

如果你不想安装插件,可以在项目的 CLAUDE.md 中添加以下内容:

## 提交规范

使用 gitmoji 常规提交:

\`\`\`
<gitmoji> <type> <description>
\`\`\`

类型:add,fix,improve,update,remove,refactor,rename,move,upgrade,downgrade

规则:
- 使用小写字母
- 使用祈使语气("add" 而不是 "added")
- 每个提交包含一个逻辑更改
Last updated on 01/14/2026