@aurthle/commit-cli v1.0.0
Lobe Commit is a CLI tool that uses ChatGPT to generate Gitmoji-based commit messages
English · 简体中文 · Changelog · Report Bug · Request Feature
TOC
✨ Features
- 🤯 Supports auto-generating commit messages based on diffs using ChatGPT
- 🛠️ Supports streamlined commit message editing workflow
- 😜 Supports adding Gitmojis
- 📝 Supports Conventional Commits specification
- ⚡️ Supports pulling a list of issues and convenient binding
- 💄 Supports custom prompts
- 🗺️ Supports multi-language commit messages
📦 Installation
To install Lobe Commit, run the following command:
npm install -g @lobehub/commit-cli
[!IMPORTANT]\ Please make sure you have
Node.js
version >= 18
🤯 Usage
You can use the lobe-commit
command to generate a commit message for your staged changes:
$ git add <files...>
$ lobe-commit
[!NOTE]\ Use the
lobe
alias iflobe-commit
is too long for you.
AI mode
With AI mode, you can generate a complete commit message using ChatGPT.
[!IMPORTANT]\ To use AI auto-generation, you need to fill in your OpenAI token in the settings by
lobe-commit -o
. and if you have special network requirements, you can add OpenAI's forwarding address in the settings.
Editor mode
In Editor mode, you can choose the <type>(<optional scope>): <subject> [<issues>]
format by following a simple flow.
[!NOTE]\ If your project is a GitHub repository, the Editor mode feature will automatically fetch the issues associated with your repository. You can select multiple issues to link to your commit message by space .
Git hook
You can integrate Lobe Commit with Git via the prepare-commit-msg
hook. This allows you to use Git as you normally would and edit the commit message before committing.
Install
To install the hook in the Git repository, run the following command:
$ lobe-commit --init # or use short flag -i
Uninstall
To uninstall the hook from the Git repository, run the following command:
$ lobe-commit --remove # or use short flag -r
Configuration
To configure Lobe Commit, run the following command:
$ lobe-commit --option # or use short flag -o
Running
To make a commit, run one of the following commands:
$ lobe-commit --hook # Run either of the two commands
$ git commit
- To use AI auto-generation, you need to fill in your OpenAI token in the settings.
- To automatically pull private issues, you need to fill in your GitHub token with repo permissions in the settings.
Options
Lobe Commit supports the following options:
--hook Commit interactively using prompts
-a, --ai Generate prompts by ChatGPT
-o, --option Setup lobe-commit preferences
-i, --init Initialize lobe-commit as a commit hook
-r, --remove Remove a previously initialized commit hook
-l, --list List all commit types supported
-V, --version Print lobe-commit installed version
-h, --help Print basic options
⌨️ Local Development
You can use Github Codespaces for online development:
Or clone it for local development:
$ git clone https://github.com/lobehub/lobe-cli-toolbox.git
$ cd lobe-cli-toolbox
$ bun install
$ cd packages/lobe-commit
$ bun dev
🤝 Contributing
Contributions of all types are more than welcome, if you are interested in contributing code, feel free to check out our GitHub Issues to get stuck in to show us what you’re made of.
🔗 Links
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
- 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
📝 License
5 months ago