/rgpt

Primary LanguageRust

Contributors Forks Stargazers Issues MIT License


image

RGPT

The RGPT tool allows you to interact with OpenAI's GPT API through the command-line interface.
Featuring a pre-configured prompt, it enables users to directly engage with the API from their terminal.

rgpt_demo.mp4
Table of Contents
  1. Getting Started
  2. Usage
  3. Contributing
  4. License
  5. Contact
  6. Acknowledgments


Getting Started

Configure your shorthand commands in the settings.json file. And then run the rgpt command with the shorthand command and the text you want to send to the API.

Prerequisites

Installation

  1. Set the OpenAI Api Key in .env
    OPENAI_API_KEY={YOUR_KEY_HERE}  
  2. Configure the prompt and key shortcut in settings.json
    mv .settings.example.com settings.json
  3. Build the rust cli application
    cargo build --release
  4. Configure rgpt as a global command in the terminal (In ~/.bashrc or ~/.zshrc)
    # Add the line to enable `rgpt` command in the terminal
    alias rgpt="{YOUR_PATH_TO_RGPT_REPO}/rgpt/target/release/rgpt"

(back to top)

Usage

  rgpt gc "This is a example of there is some grammar error in it"

  # This will trigger the "gc" shorthand from the settings.json
  # settings.json { "gc": { prompt: "Correct the following text for me:"}}

  # The output will be:
  "This is an example of there being some grammar error in it."

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See here for more information.

(back to top)

Contact

@mhtsai_95

(back to top)