Skip to content

Kenshinhu/commitgpt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Update December 12, 2022

OpenAI added additional Cloudflare protections that make it more difficult to access the unofficial API. The tool is not working temporary until I find a way to workaround it.

More details in the issue.

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 the terminal prompt.

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

  • TypeScript 60.1%
  • JavaScript 39.9%