Coder Social home page Coder Social logo

cg's Introduction

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

cg's People

Contributors

25077667 avatar t5scc avatar dependabot[bot] avatar

Stargazers

QQ avatar  avatar Jamie Tu avatar Afan Chen avatar CHEN, YU-YU avatar birdshiu avatar Ernie Chu avatar Zeze avatar LO avatar 牧羊犬真Q avatar Cycatz avatar aesophor avatar

Watchers

Kostas Georgiou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.