@shencom/ai-commit
v1.0.5
Published
Automatically generate commit messages using ChatGPT
Downloads
3
Maintainers
Readme
@shencom/ai-commit
Automatically generate commit messages using ChatGPT
Installation
npm install -g @shencom/ai-commit
Usage
Init
sc-commit init
then edit config file:
{
"language": "zh or en",
"datasource": "openai or azure",
"openai_api_key": "xxxxx",
"azure_api_key": "xxxxx",
"azure_deployment_id": "xxxx",
"azure_base_url": "https://xxxxxxx.openai.azure.com",
"azure_model": "gpt-3.5-turbo-16k",
"azure_api_version": "2023-07-01-preview"
}
Run
git add . # git add files
sc-commit # generate commit log only
Parameter
sc-commit --verbose # generate with prompt display
sc-commit --debug # generate with prompt display
sc-commit init # Init config
sc-commit get config # View the configuration
sc-commit get template # View Prompt
sc-commit set template # View Prompt
Default Prompt
You can override the configuration by modifying the global files .config/shencom/ai-commit/template.zh
or .config/shencom/ai-commit/template.en
How it works
- Runs git diff --cached
- Sends the diff to ChatGPT and asks it to suggest commit messages
- Shows suggestions to the user