gpterm
gpterm copied to clipboard
terminal client for openai's GPT completion APIs
gpterm (GPT terminal)
gpterm is a terminal-based integration with the OpenAI chat API.
Example
https://user-images.githubusercontent.com/596076/230783174-67f512d2-9c8f-4131-a043-db7083b16a04.mp4
gpterm also renders Markdown and syntax-aware code blocks:
Installation
Requirements:
- Go 1.18 or higher
- GOPATH env variable set (install will write to
$GOPATH/bin) - OpenAI API Key
To install from source:
git clone https://github.com/collinvandyck/gpterm.git
cd gpterm
make install
Getting Started
Because it uses the OpenAI API, an API key is required before you can start:
# set api key
gpterm auth
Once the API key has been set, have fun!
# enter an interactive session
gpterm
Using gpterm
Once you're in gpterm, there are a handful of controls you can use to tailor your experience.
Ctrl-yspawn an editor to craft your message instead of using the text widget.Ctrl-p/Ctrl-nswitch between previous and next conversations.Ctrl-xdrops the current conversation.Ctrl-xagain to confirm.F1/F2change the amount of conversation context sent to OpenAI on each request. Higher values will result in more coherence but at a greater API cost.F3change the GPT model. Currently supportsgpt-3.5-turboandgpt-4. You must havegpt-4access for that mode to work. Because costs between the models are quite different, gpterm remembers the amount of conversation context to send per-model.
Storage
Chat history and your API key are stored in a sqlite database in:
~/.config/gpterm
Upcoming
Configurable Roles
Users will be able to instruct OpenAI how to act. Currently it's hardcoded to You are a helpful assistant.
Additionally, users should be able to change the name of the assistant as rendered in the chatlog. Current it is ChatGPT.
Gist Support
Conversations should be able to be uploaded to a gist.
Hotkey Support
Actions should be able to be found to user-configured keys.