@mp-lb/catgpt
v0.1.0
Published
A tiny ChatGPT-style terminal client built with React, Blessed, and the Vercel AI SDK.
Readme
CatGPT
A tiny ChatGPT-style terminal client built with React, Blessed, and the Vercel AI SDK.
Run
npm install
npm startOptional:
CATGPT_MODEL=gpt-4o-mini npm start
CATGPT_HOME=/path/to/data npm startData is stored locally in ~/.catgpt/catgpt.sqlite unless CATGPT_HOME is set. API keys are stored in ~/.catgpt/keys.json.
Controls
- Click a chat in the sidebar to switch.
- Type in the bottom input and press
Enterto send. - Press
Escto leave the input. - When the input is not focused, use
j/kto move through chats andnto create a new chat. - When the input is not focused, press
xto move the active chat to trash. - Use
iorTabto focus the input again. - When the input is not focused, press
/to open the command input. - Press
Ctrl+Cto quit.
Composer Editing
The message composer uses CatGPT's own text buffer instead of Blessed's textbox editing.
Entersends the message.Ctrl+Jinserts a newline.Ctrl+WorAlt+Backspacedeletes the previous word.Ctrl+A/Ctrl+Emove to the start/end of the current line.Ctrl+B/Ctrl+For arrow keys move left/right.Alt+B/Alt+Fmove by word.Ctrl+U/Ctrl+Kdelete to the start/end of the current line.
Commands
Commands run from the command input, opened with /.
/settings/set hideWelcome true/set hideWelcome false/keys/key set openai sk-.../key set openrouter sk-or-.../key remove openai/models/models claude/model set moonshotai/kimi-k2.6/trash clear
OpenRouter models are discovered from OpenRouter's models API when an OpenRouter key is configured.
After /models search, use Up/Down to move, j/k to page, i for details, and a to activate the selected model.
Structure
src/main.jswires app state, hotkeys, streaming, persistence queues, and command dispatch.src/ui.jscontains the Blessed/React components.src/storage.jsowns SQLite chat and settings persistence.src/providers.jsowns key loading, provider resolution, and model discovery.src/commands.jsparses slash commands and returns state/output changes.src/settings.js,src/paths.js, andsrc/chats.jshold small shared app utilities.
