1
GitHub - RomanHotsiy/commitgpt: Automatically generate commit messages using Cha...
source link: https://github.com/RomanHotsiy/commitgpt
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
commitgpt
Automatically generate commit messages using ChatGPT.
How to use?
npx commitgpt
or use -c
for conventional commits format.
npx commitgpt -c
On the first run you will be asked to enter your OpenAI session token.
Get your session token
- Go to https://chat.openai.com/chat and log in or sign up.
- Open console with
F12
. - Open
Application
>Cookies
. - Copy the value for
__Secure-next-auth.session-token
and paste it intoconfig.json.example
undersession_token
. You do not need to fill outAuthorization
- Save the modified file to
config.json
(In the current working directory)
How it works
- Runs
git diff --staged
- 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.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK