Giter Club home page Giter Club logo

gopt's Introduction

GOPT - GPT CLI made of Golang

GOPT is a command line interface that uses OpenAI's gpt-3.5-turbo API to generate responses to user input.

Table of Contents

  1. Installation
  2. Usage
  3. Issues
  4. Contact
  5. License

Installation

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have installed the latest version of Go (1.20 or higher as of this writing).

Go install

You can install the gopt binary directly, by using go install

go install github.com/nicewook/gopt@latest

After running this command, Go downloads the source code, compiles the package and installs the binary to $GOPATH/bin (or $GOBIN if set).

Or, you can git clone the whole repository and build like this

git clone https://github.com/nicewook/gopt.git
cd gopt
go build

Configuration

The app need OPENAI_API_KEY to use OpenAI API.

Your OpenAI API key. Required to make requests to the OpenAI API.

  • You can set it as a environment variable.
    export OPENAI_API_KEY=YOUR_KEY_HERE
    
  • OR, GOPT will ask you to enter API key. the key will be saved in $HOME/.gopt/config.json as a plaintext.

Usage

  • Write a message and press enter to send it.
  • The app will send the message to OpenAI's API and return a response.
  • The response will be displayed below your message.
  • Keep entering messages to continue the conversation.
    • The conversation will be saved and sent along with the next message.
    • And conversation will be deleted from the oldest one due to token limitation.
  • Enter exit at any time to exit the app.

Commands on gpt shell mode

  • help - Displays command usage.
  • config - Displays configuration information.
  • context - Displays the conversation context which reserved at the moment.
  • reset - Reset all the conversation context.
  • exit or q - Exits the app.

Issues

Please open an issue on GitHub to report any problems or make feature requests.

Contact

If you want to contact me you can reach me at [email protected].

License

This project is licensed under the terms of the MIT license. See the LICENSE file for details.

gopt's People

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.