DEV Community

Cover image for OpenCommit: CLI to generate impressive commits in 1 second with GPT πŸ€―πŸ”« (v 2.0)
Dima Sukharev
Dima Sukharev

Posted on • Updated on

OpenCommit: CLI to generate impressive commits in 1 second with GPT πŸ€―πŸ”« (v 2.0)

first β€” let's grow my twitter, so i can tell about my inventions quicker and make the world even better place (or not, idk)


opencommit β€” comparison

A month ago I opensourced OpenCommit.

Previous post got 60k views and 280 likes. Now OpenCommit is 2.6k stars.

I've merged 39 PRs and here is what's new:

  • if you change model to GPT-4 β€” it answers WHY changes were done 🀯
  • locale support of 10 languages.
  • select files you want to stage and commit.
  • choose a remote you want to push to.
  • OpenCommit now uses tiktoken to accurately count openAI tokens.
  • better large diffs splitting (you can commit changes of any size)
  • add any git commit arguments to oc <...args> it will be passed to git commit <...args>.
  • hook now works on all platforms, run oc hook set to integrate OpenCommit into IDE Source Control.

Well this is it so far, thanks to all the contributors <3 Feel free to PR!

How to install OpenCommit

Simply install it globally with npm, to use in any repo:

npm i -g opencommit
Enter fullscreen mode Exit fullscreen mode

After installing type oc and hit "Enter" in a terminal:

oc
Enter fullscreen mode Exit fullscreen mode

If you want to edit a commit and make OpenCommit to be used by your IDE do:

oc hook set
Enter fullscreen mode Exit fullscreen mode

That's it β€” have fun ;)

Top comments (22)

Collapse
 
eliazer_braun_2b427f370f4 profile image
Eliazer Braun

I installed it a few weeks ago and love it, how do I update it to use GPT-4?

Collapse
 
disukharev profile image
Dima Sukharev
Collapse
 
eliazer_braun_2b427f370f4 profile image
Eliazer Braun

How do you switch back to 3.5?
oc config set model=gpt-3.5 ?

Thread Thread
 
a12bcx profile image
Vlad

oc config set model=gpt-3.5-turbo

Thread Thread
 
eliazer_braun_2b427f370f4 profile image
Eliazer Braun

Thanks,
I am getting this error
β”” βœ– Error: Unsupported config key: model

Collapse
 
kubulashvili profile image
Aleksey Kubulashvili

I don't use commits frequently in my work, but it seems that it saves a lot of time.

Collapse
 
dmitry_i_57e465c3faaac74f profile image
Dmitry i

Congrats with new version

Collapse
 
moulick profile image
Moulick Aggarwal • Edited

What are its pros and cons vs the aicommits project?

Collapse
 
disukharev profile image
Dima Sukharev • Edited

with OC you can commit extremely large batches of files, more CLI features for your convenience, localisation for 10+ languages, lots of settings like switching to GPT-4 (which understands WHY changes were done)

Collapse
 
__c33c7860d4 profile image
Π ΠΎΠΌΠ°Π½ Π§Π΅Ρ€Π½Ρ‹ΡˆΠΎΠ²

I've tried it and even returned back to say thanks!

Collapse
 
disukharev profile image
Dima Sukharev

thats great!

Collapse
 
abitrolly profile image
Anatoli Babenia

Is there an offline version that doesn't share code with OpenAI servers?

Collapse
 
disukharev profile image
Dima Sukharev

nope, but PRs are welcome <3

Collapse
 
abitrolly profile image
Anatoli Babenia

Do you know what to include in the PR?

Collapse
 
rutexd profile image
rutexd

Commit messages should describe why code is changed, not what is changed...

Collapse
 
disukharev profile image
Dima Sukharev

it does if you switch to GPT-4 via the settings

Collapse
 
rnkrnk profile image
RN • Edited

Would like to see examples that are more complex than "remove / add something".

Collapse
 
hngvchnh1 profile image
HΖ°ng VΓ΅ ChΓ‘nh

However may be OC has read your production code

Collapse
 
disukharev profile image
Dima Sukharev

its open-source bro, check the code lol

Collapse
 
serjobas profile image
Sergey Bunas

nice! I mean really nice!

Collapse
 
azhe403 profile image
Azhe Kun

commit-gpt

Collapse
 
disukharev profile image
Dima Sukharev • Edited

what is up with it? it looks abandoned, last issue closed in 2022