Files
opencommit/README.md
di-sukharev d785b821ea * 📝 docs(README.md): comment out Git hook section
The Git hook section has been commented out as it is not currently relevant to the project.
2023-03-06 19:27:19 +08:00

2.6 KiB

OpenCommit logo

OpenCommit

Author @di-sukharev

AI generates conventional commits with mind-blowing accuracy

Current version

Examples

Look into the commits to see how OpenCommit works. Emoji and long commit description text is configurable.

Setup

The minimum supported version of Node.js is the latest v14. Check your Node.js version with node --version.

  1. Install opencommit globally to use in any repository:

    npm install -g opencommit
    
  2. Get your API key from OpenAI

  3. Set the key to opencommit config:

    opencommit config set OPENAI_API_KEY=<your token>
    

    Your token isn't sent to anyone, it's saved in ~/.opencommit config file.

Usage

You can call opencommit directly to generate a commit message for your staged changes:

git add <files...>
opencommit

You can also use the oc shortcut:

git add <files...>
oc

Features

Preface commits with emoji 🤠

GitMoji convention is used.

To add emoji:

opencommit config set emoji=true

To remove emoji:

opencommit config set emoji=false

Postface commits with descriptions of changes 🤠

To add descriptions:

opencommit config set description=true

To remove description:

opencommit config set description=false

Payments

You pay for your own requests to OpenAI API. OpenCommit uses ChatGPT official model, that is ~10x times cheaper than GPT-3.