This is a package that generates commit messages using OpenAI's GPT models.
The default GPT model is set to gpt-3.5-turbo.
commit-message-generator on npmjs
The package can be installed using npm or yarn.
- yarn
yarn global add commit-message-generator- npm
npm install -g commit-message-generatorUse the setkey command to register the openai api key.
cmg setkey- Write the details of the changes you want to commit using the
generatecommand.
cmg generate <request message>
or
cmg g <request message>- Review the output.
cmg generate "initialize the project"
# output
🎉 init: Initialize the project- Use the
diffcommand to specify the file/directory.
cmg diff <filePath>
or
cmg d <filePath>- Review the output.
cmg diff src/components/TestComponent
# output
feat: add console log for testingUse the config command to set commit rules.
This command opens the config file which can be freely modified by the user.
cmg configformat: Defines the format of the output commit message.commitTypes: Defines the types of commits.localRules: Allows setting limits on commit messages.gpt_model: Sets the GPT Model.
Use the setmodel command to set the AI model you want to use.
cmg setmodel