gpterm is a terminal-based integration with the OpenAI chat API.
image-2023-04-09-t9i9MeKD.mp4
gpterm also renders Markdown and syntax-aware code blocks:
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
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
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.
Chat history and your API key are stored in a sqlite database in:
~/.config/gpterm
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.
Conversations should be able to be uploaded to a gist.
Actions should be able to be found to user-configured keys.