Lobe Commit 是一款使用 ChatGPT 生成基于 Gitmoji 的 CLI 提交工具
English・简体中文・Changelog · Report Bug · Request Feature
- 🤯 支持使用 ChatGPT 根据 git diffs 自动生成提交信息
- 🛠️ 流畅的提交信息编辑流程
- 😜 支持添加 Gitmoji
- 📝 支持 Conventional Commits 规范
- ⚡️ 支持拉取 issues 列表并便捷绑定
- 💄 支持自定义 Prompt
- 🗺️ 支持多语言提交信息
要安装 Lobe Commit,请运行以下命令:
npm install -g @lobehub/commit-cli
Important
请确保环境中 Node.js
版本 >= 18
使用 lobe-commit
命令为暂生成提交信息信息:
$ git add <files...>
$ lobe-commit
Note
如果认为 lobe-commit
太长了,可以使用lobe
别名
在 AI 模式下,可以使用 ChatGPT 生成完整的提交信息
Important
需要在设置中 lobe-commit -o
配置 OpenAI 令牌,同时如果有特殊的网络要求,也可以在设置中配置 OpenAI 的转发地址
在编辑器模式下,可以通过简单的流程生成 <type>(<optional scope>): <subject> [<issues>]
格式的提交信息,使用 TAB 返回上一步
Note
如果项目是 GitHub Repo,则将自动获取该仓库的 issues,可以使用 空格 选择多个问题将其链接到提交信息中
可以通过 prepare-commit-msg
钩子将 Lobe Commit 与 Git 集成,允许像往常一样使用 Git 并在提交之前编辑提交信息
要在项目中安装 hook,请运行以下命令:
$ lobe-commit --init # 或使用短标志 -i
要从项目中卸载 hook,请运行以下命令:
$ lobe-commit --remove # 或使用短标志 -r
要配置 Lobe Commit,请运行以下命令:
$ lobe-commit --option # 或使用短标志 -o
要进行 commit 提交,请运行以下命令:
$ lobe-commit --hook # 两个命令任选其一
$ git commit
Lobe Commit 支持以下选项:
--hook 使用基于提示的交互方式进行 commit 提交
-a, --ai 由 Ai 生成提示
-o, --option 设置 lobe-commit 首选项
-i, --init 将 lobe-commit 初始化为提交钩子
-r, --remove 移除先前初始化的提交钩子
-l, --list 列出所有支持的提交类型
-V, --version 打印 lobe-commit 的安装版本
-h, --help 打印基本选项
可以使用 Github Codespaces 进行在线开发:
或者,可以克隆存储库并运行以下命令进行本地开发:
$ git clone https://github.com/lobehub/lobe-cli-toolbox.git
$ cd lobe-cli-toolbox
$ bun install
$ cd packages/lobe-commit
$ bun dev
我们非常欢迎各种形式的贡献。如果你对贡献代码感兴趣,可以查看我们的 GitHub Issues,大展身手,向我们展示你的奇思妙想。
- 🤖 Lobe Chat - An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application.
- 🤯 Lobe Theme - The modern theme for stable diffusion webui, exquisite interface design, highly customizable UI, and efficiency boosting features.
- langchainjs - https://github.com/hwchase17/langchainjs
- ink - https://github.com/vadimdemedes/ink
- gitmoji-commit-workflow - https://github.com/arvinxx/gitmoji-commit-workflow
- gitmoji-cli - https://github.com/carloscuesta/gitmoji-cli