Crates.io | gptui |
lib.rs | gptui |
version | 0.1.0 |
source | src |
created_at | 2023-12-26 22:18:41.287893 |
updated_at | 2023-12-26 22:18:41.287893 |
description | A TUI interface for OpenAI Chat Completions |
homepage | |
repository | https://github.com/keagud/gptui |
max_upload_size | |
id | 1081235 |
size | 170,794 |
GPTui is a fairly simple TUI for interacting with the OpenAI Chat Completions API.
I prefer the question-and-answer style of interaction with LLMS for programming assistance (as opposed to something like Copilot's autocomplete), and I wanted to make an interface designed with that in mind, that could also slot into my existing CLI/TUI based workflow. If you're a fellow vim/tmux/alacritty enjoyer, consider giving it a shot!
You'll need an OpenAI API key to get started. Anecdotally, GPTui is pretty cheap, even with heavy usage, since it's all text and doesn't use any of the multi-modal bells and whistles of the API. You can provide your API key in one of two ways:
config.toml
(see below for more on that.)comptime-key
feature enabled, the value of OPENAI_API_KEY will be read and compiled into the binary itself. This means you don't have to keep the key in the environment, but if you change your key you'll need to recompile.When first run, a commented config.toml
file will be generated wherever config files belong on your platform (on Linux it's $XDG_CONFIG_HOME).
Start a new conversation thread
Usage: gpt new [OPTIONS]
Options:
-p, --prompt <PROMPT> Prompt to use
-h, --help Print help
Resume a previous conversation
Usage: gpt resume <INDEX>
Arguments:
<INDEX>
Options:
-h, --help Print help
Delete a conversation thread permanently
Usage: gpt delete <INDEX>
Arguments:
<INDEX>
Options:
-h, --help Print help
List all saved threads
Usage: gpt list
Options:
-h, --help Print help
Delete all conversation threads
Usage: gpt clear
Options:
-h, --help Print help
Alt-Enter: submit message
Ctrl-e: Open the message buffer in an external editor ($EDITOR if available, a safe default for the platform if not). Save and quit the editor window when you're done to return.
Ctrl-w: Enter copy mode
Esc: Exit copy mode
Up/Down: Scroll the chat history
Ctrl-c: Exit the program