gptx (GPT for Unix) is a simple Rust program for interacting with OpenAI's GPT APIs. Its goal is to offer a simple yet extensible component to act as

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-06-11 18:30:40

gptx (GPT for Unix) is a simple Rust program for interacting with OpenAI's GPT APIs. Its goal is to offer a simple yet extensible component to act as a building block in a Unix CLI workflow, allowing easy integration of LLMs with traditional scripts and programs. For example, a simple shell script combining gptx, dmenu and xsel could be used to create a quick dictionary lookup or translation tool. A collection of community scripts making use of gptx can be found at the bottom of this document.

You must provide your API KEY via the OPENAI_API_KEY environment variable, or provide it as api_key in config.toml You must also define at least a default role in config.toml

To install first run make build, then make install. This will install gptx to ~/.local/bin and an example config to ~/.config/gptx/.

If gptx is started with no arguments it will automatically start REPL mode. REPL mode allows you to carry out a conversation with the selected role. Additional REPL mode can be triggered by the -R flag, which allows you to provide an initial prompt and still enter REPL mode (e.g, gptx -R "what is the capital of France")

Leave a Comment