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 β€’ Edited on

41 19 18 18 18

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 ;)

Image of Timescale

πŸš€ pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applicationsβ€”without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

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