gopt

command module
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 1 Imported by: 0

README

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.
  • clear - Clear terminal.
  • 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 nicewook@hotmail.com.

License

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

Documentation

Overview

Copyright © 2023 Hyunseok Jeong nicewook@hotmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL