3 unstable releases

0.1.1 May 12, 2023
0.1.0 May 12, 2023
0.0.1 May 12, 2023

#15 in #powered

36 downloads per month

MIT license

24KB
143 lines

gh-gpt

Github AI-powered bot 🤖.

GitHub Workflow Status Project license Pull Requests welcome

gh-gpt is a Rust-based command line tool that uses the power of ChatGPT to automate tasks on Github. With gh-gpt, you can automatically add relevant labels to a Github issue, among other tasks.

gh-gpt banner

Table of Contents

Installation

gh-gpt requires a recent version of Rust. You can install Rust through the rustup toolchain installer here.

Once Rust is installed, you can install gh-gpt using Cargo:

cargo install gh-gpt

Configuration

gh-gpt uses dotenv to automatically load environment variables from a .env file. You can also set these variables manually in your environment. Here is an example of the configuration variables used:

# Github
GH_GPT_GITHUB_TOKEN="..."
GH_GPT_OPENAI_API_KEY="..."

# OpenAI
GH_GPT_CHATGPT_MODEL="gpt-4"
GH_GPT_CHATGPT_MAX_TOKENS="4096"

Replace the "..." with your actual tokens and preferences.

Usage

gh-gpt currently supports the following commands:

  • labelize - Automatically add relevant labels to a Github issue.
  • help - Print help message or the help of the given subcommand(s).

You can view help for the CLI tool with:

    gh-gpt help

Labelize

To automatically add relevant labels to a Github issue, use the labelize command:

gh-gpt labelize [repo_owner] [repo_name] [issue_number]

For example, to labelize issue #1 of keep-starknet-strange/madara you would run:

gh-gpt labelize keep-starknet-strange madara 1

Contributing

Contributions to gh-gpt are welcomed! Feel free to submit a pull request or create an issue.

License

gh-gpt is licensed under the MIT License.

Dependencies

~27–42MB
~763K SLoC