1

GitHub - RomanHotsiy/commitgpt: Automatically generate commit messages using Cha...

 1 year ago
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.

commitgpt

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

  1. Go to https://chat.openai.com/chat and log in or sign up.
  2. Open console with F12.
  3. Open Application > Cookies.
    image
  4. Copy the value for __Secure-next-auth.session-token and paste it into config.json.example under session_token. You do not need to fill out Authorization
    image
  5. 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.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK