Skip to content

Latest commit

 

History

History
60 lines (49 loc) · 1.33 KB

README.md

File metadata and controls

60 lines (49 loc) · 1.33 KB

The cg (commit generator) tool which is generated by OpenAI's API.

Demo:

Requirements:

  • Python 3.10+
  • poetry
  • OpenAI API key

The OpenAI API key:

You can get the OpenAI API key from here.

Our python code in src/config_parser.py:

GPT_TOKENS = tuple(os.environ.get('GPT_TOKENS', '').replace(
    ';', ',').replace(':', ',').split(','))

So, you can set the environment variable GPT_TOKENS to your OpenAI API keys. Or you could just insert your API key to the GPT_TOKENS config file (~/.cg/config.json).

Usage:

Download the binary from the latest release:

Linux:

./cg.elf

Before we publish this tool to the package manager, you could use this command to link the binary to /usr/local/bin/cg:

sudo ln -s ./cg.elf /usr/local/bin/cg

Mac:

./cg.macho

Windows:

.\cg.exe

Using the raw python code:

$ poetry install
$ poetry run python ./main.py

Todo:

  • Benchmark with other famous commit message generator
  • Smarter prompt for commit message
    • Use score to measure the quality of the commit message
  • Binary for Windows, Linux, and Mac
  • Tests and CI
  • Publish to PyPI, Homebrew, AUR, and scoop

License:

GPLv3