term-gpt is a fast, colorful, file-aware ChatGPT client for your terminal.
It supports one-shot prompts, REPL mode, file context, and a custom assistant personality.
Use it like:
gpt "Explain Rust ownership like I'm an exhausted developer."Or enter interactive chat:
gpt --replSupports injecting files into the prompt:
gpt -f src/main.rs "Explain what this code does."- 🔥 One-shot prompts
- 💬 Interactive REPL mode (
--repl) - 📄 Include files as context (
-f path/to/file) - 🎨 Colored output (user blue, assistant green)
- 🧠 Custom assistant personality baked into the tool
- 🔐 Uses your own OpenAI API key
- ⚙️ Configurable, simple, and fast
cargo install --git https://github.com/reidctl/term-gptOr install through cargo:
cargo install term-gptexport PATH="$HOME/.cargo/bin:$PATH"export OPENAI_API_KEY="sk-your-key-here"
⚠️ Never hardcode your API key into source files.
⚠️ Never commit.envfiles with secrets.
gpt "Write me a haiku about Rust and caffeine dependency."gpt -f src/main.rs "Explain this code."Multiple files:
gpt -f src/main.rs -f README.md "Summarize the project."gpt --replQuit with:
:q
You > Why is Rust so strict?
Assistant >
Because Rust is the gym coach who screams “FORM MATTERS”
while making sure you don’t blow out your back doing a deadlift
with a null pointer.
git clone https://github.com/reid-ctl/term-gpt
cd gpt
cargo build --releaseOptimized binary:
target/release/gpt
Symlink:
sudo ln -s $(pwd)/target/release/gpt /usr/local/bin/gptThis CLI uses OpenAI’s Responses API.
You can tweak:
- model
- assistant personality
- formatting/colors
- REPL behavior
Inside DEFAULT_PERSONALITY in main.rs.
- Streaming responses
-
--modelflag - Save chat transcripts
- Pipe stdin (
cat file | gpt) - Shell completions
- Arch package (
PKGBUILD)
MIT — do whatever you want, just don’t sue me if you anger the borrow checker.
Made by Garrett Reid,
powered by Rust, caffeine, and an unhealthy relationship with terminal prompts.