2.15.0 • Published 2 months ago

@lobehub/commit-cli v2.15.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Lobe Commit 是一款使用 ChatGPT 生成基于 Gitmoji 的 CLI 提交工具

English・简体中文・Changelog · Report Bug · Request Feature

npm.io

TOC

✨ 特性

  • 🤯 支持使用 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 模式

在 AI 模式下,可以使用 ChatGPT 生成完整的提交信息

[!IMPORTANT]\ 需要在设置中 lobe-commit -o 配置 OpenAI 令牌,同时如果有特殊的网络要求,也可以在设置中配置 OpenAI 的转发地址

npm.io

编辑器模式

在编辑器模式下,可以通过简单的流程生成 <type>(<optional scope>): <subject> [<issues>] 格式的提交信息,使用 TAB 返回上一步

[!NOTE]\ 如果项目是 GitHub Repo,则将自动获取该仓库的 issues,可以使用 空格 选择多个问题将其链接到提交信息中

npm.io

Git hook

可以通过 prepare-commit-msg钩子将 Lobe Commit 与 Git 集成,允许像往常一样使用 Git 并在提交之前编辑提交信息

安装

要在项目中安装 hook,请运行以下命令:

$ lobe-commit --init # 或使用短标志 -i

卸载

要从项目中卸载 hook,请运行以下命令:

$ lobe-commit --remove # 或使用短标志 -r

配置

要配置 Lobe Commit,请运行以下命令:

$ lobe-commit --option # 或使用短标志 -o
  • 要使用 AI 自动生成,需要在设置中填写 OpenAI 令牌
  • 要自动拉取私人仓库 issues,需要在设置中填写具有 repo 权限的 GitHub 令牌

选项

Lobe Commit 支持以下选项:

--commit -c 使用提示交互式提交
--option -o 设置lobe-commit首选项
--help -h 打印基本选项
--init -i 将lobe-commit初始化为提交钩子
--remove -r 删除先前初始化的提交钩子
--list -l 列出所有可用的提交类型
--version -v 打印lobe-commit安装版本

⌨️ 本地开发

可以使用 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,大展身手,向我们展示你的奇思妙想。

🔗 链接

More Products

  • 🤖 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.

Credits


📝 License

Copyright © 2023 LobeHub. This project is MIT licensed.

2.15.0

2 months ago

2.14.1

2 months ago

1.9.0

10 months ago

1.8.0

10 months ago

2.11.0

6 months ago

2.10.1

6 months ago

2.3.0

10 months ago

2.12.0

6 months ago

2.2.0

10 months ago

2.1.1

10 months ago

2.5.0

10 months ago

2.10.0

7 months ago

2.4.0

10 months ago

2.7.0

10 months ago

2.6.0

10 months ago

2.9.0

8 months ago

2.8.0

10 months ago

2.1.0

10 months ago

2.0.0

10 months ago

2.9.2

8 months ago

2.9.1

8 months ago

2.9.3

8 months ago

2.13.0

6 months ago

2.14.0

6 months ago

1.10.1

10 months ago

1.10.0

10 months ago

1.7.3

11 months ago

1.7.2

11 months ago

1.7.1

11 months ago

1.7.0

12 months ago

1.6.0

12 months ago

1.5.0

12 months ago

1.4.0

12 months ago

1.3.1

12 months ago

1.3.0

12 months ago

1.2.0

12 months ago

1.1.2

12 months ago

1.1.1

12 months ago

1.1.0

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago