RomanHotsiy / commitgpt

Automatically generate commit messages using ChatGPT
1.57k stars 92 forks source link

Total Refactor #27

Closed erfanium closed 1 year ago

erfanium commented 1 year ago

I really enjoy this idea. so i spend a day on it to make it the best for real usages in the teams. hope you like it🍩

OpanAI api

it now uses the official api so no more hacks to use chatgpt. it's way safer. also user can choice available openai models

optional global and per project config files

by using .commitgpt-template config file, it's possible to fine-tune and change the model prompt to fit project needs. also everyone has it's own take on the definition of a good commit message. so it's possible to personalize it

by using .commitgpt.json it's possible to use other openai models and change the input parameters.

better default prompt

it suggests better results. all of them are in <type>(<scope>): <description> format.

basic token limiter

openai api will fail on huge diff. so i made a very simper limiter to get around this problem.

Note

I removed the show more suggestions option because current implementation is not really helpful. we are not sending the current suggestions to the model for the new suggestions. it's way better to implement it as a commit text completer like GitHub copilot

genesiscz commented 1 year ago

Is there a way to use your version/your fork?

erfanium commented 1 year ago

@genesiscz

npm install -g https://github.com/erfanium/commitgpt

should be working

RomanHotsiy commented 1 year ago

Thanks @erfanium! This is great! ❤️

Sorry it took me so long to review/merge. Was super busy.

RomanHotsiy commented 1 year ago

I released a new version 2.0.0