@shencom/ai-commit
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

@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

ai-commit-template.zh
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

Package Sidebar

Install

npm i @shencom/ai-commit

Weekly Downloads

4

Version

1.0.5

License

ISC

Unpacked Size

201 kB

Total Files

17

Last publish

Collaborators

  • shencom