8000 GitHub - nSimonFR/commitgpt: Automatically generate commit messages using ChatGPT
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Oct 21, 2023. It is now read-only.

nSimonFR/commitgpt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

commitgpt

Automatically generate commit messages using ChatGPT.

commitgpt

How to use?

npx commitgpt

or use -c for conventional commits format.

npx commitgpt -c

Getting Your OpenAI API Key and Setting the Environment Variable

  1. Sign up for an OpenAI account and log in to the OpenAI dashboard: https://beta.openai.com/signup
  2. Generate a new API key by clicking on the "API Keys" tab and then clicking on the "Create API Key" button.
  3. Copy the API key to your clipboard.
  4. Open a terminal or command prompt and set the environment variable with the API key using the following command (replace "YOUR_API_KEY" with the actual API key you copied in step 3):
export OPENAI_API_KEY="YOUR_API_KEY"
  1. Verify that the environment variable has been set correctly by running the following command:
echo $OPENAI_API_KEY

This should print the value of the OPENAI_API_KEY environment variable, which should be the API key you set in step 4.

Note: The steps to set environment variables may differ based on your operating system. For more information, you can refer to the documentation for your specific operating system.

How it works

  • Runs git diff --cached
  • Sends the diff to ChatGPT and asks it to suggest commit messages
  • Shows suggestions to the user

Credits

Some code and approaches were inspired by the awesome projects below:


Do you need API docs? Check out Redocly.

About

Automatically generate commit messages using ChatGPT

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%
0