DEV Community

Dima Sukharev
Dima Sukharev

Posted on • Updated on

Use AI to commit like a PRO in 1 second

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


I struggled making commit messages since 2017. When you think of a commit message — you switch context from writing code. When you switch context — you waste time. Wasting time is lame.

I usually made 1 line commits like "amends", "fixed bug", "refactoring" and then tried to come up with a good general message when merging a branch to production.

It has changed when ChatGPT was published.

I open-sourced OpenCommit.

opencommit — before and after

The library uses conventional commits convention which makes commits concise and comprehensive. You can also turn on GitMoji setting if you like.

Simply install it with npm:

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

That's it.

For more info read the docs.

opencommit animation

i know it's impressive, i'll probably help the world more with other extraordinary inventions, you may follow my bird twitter

Top comments (21)

Collapse
 
blackmouse572 profile image
blackmouse572 • Edited

Just to make sure for members who want to use this for your coding life. This will charge your money 💸💸 since you are using costing version of OpenAI 🧠. But luckily, when register the account, you will get ~20 🪙 into your own account and the price is cheaper when oc using low-cost modal unlike chatGPT (~10x cheaper). With that amount I guess you can use for about over a year without any worried 💹💹.

But still, I will suggest you learn how to message better commit since it is required skill for coder inside company or freelancer. Best wishes 🌹🌹

Collapse
 
disukharev profile image
Dima Sukharev

i believe you can start using the tool and see how good commits are done, then if you dont want to spend ~$0.5 each day for the AI — you know how to do same :)

Collapse
 
blackmouse572 profile image
blackmouse572

Brilliant idea, It is a new approach I haven't considered. 😂😂

Collapse
 
floschwalm profile image
Florian Schwalm

Nice stuff as long as you are working on open source projects. I'm not quite sure yet if it works for commits that should explain the context or intent of a change rather than just what is done (which could be deducted from the diff anyway if the developer reading it is familiar enough with the field), but for simple tasks that don't need lengthy explanation it is a nice feature.

If working on proprietary code, please be aware that you may be criminally liable for leaking company secrets.
gizmodo.com/amazon-chatgpt-ai-soft...

Collapse
 
disukharev profile image
Dima Sukharev

yep, it's like sending your code to OpenAI, read their policy pls

Collapse
 
corners2wall profile image
Corners 2 Wall

It looks cool.
How about extension for IDE in the future?

Collapse
 
disukharev profile image
Dima Sukharev

you can use oc hook set to insert opencommit into the pipeline, IDEs will handle the rest <3

Collapse
 
krlz profile image
krlz

Oh cool! We need more of this type of things, for commits, for writing stories, for reviewing code .... it's a bright future for AI

Collapse
 
disukharev profile image
Dima Sukharev

thanks ;)

Collapse
 
ota200 profile image
O.T.A

This is a very useful tool.

Collapse
 
disukharev profile image
Dima Sukharev

thanks here :)

Collapse
 
bennycode profile image
Benny Code

This is impressive! Thanks for sharing. Will give it a spin! 🧠

Collapse
 
disukharev profile image
Dima Sukharev

thank you Benny ;)

Collapse
 
k1lgor profile image
k1lgor

is this a fork of aicommits?

Collapse
 
disukharev profile image
Dima Sukharev

has the same hook feature, but implements conventional commits and allows you to commit really large files (it's done in chunks)

Collapse
 
kirill_t_03ca5b6e65accdbb profile image
Kirill T

can i use it in webstorm?

Collapse
 
disukharev profile image
Dima Sukharev

it's a CLI, you can use it everywhere, any IDE. it's also possible to insert it in a git hook, so IDE uses it when you use it's Source Control feature.

Run

oc hook set
Enter fullscreen mode Exit fullscreen mode
Collapse
 
jessicakuijer profile image
jessicakuijer

Thank you so much for this amazing chat-GPT tool!!!!!
It will change my life for commits forever! I sucked all the time to explain things with details.

Collapse
 
disukharev profile image
Dima Sukharev

;)

Collapse
 
jmvk profile image
jm-vk

I expect to see this everywhere soon. Super helpful.

Collapse
 
disukharev profile image
Dima Sukharev

thank you!