← ClaudeAtlas

drive-tuilisted

Drive interactive terminal (TUI) programs — CLIs, REPLs, installers, menu apps, agent CLIs, and editors like vim — through a PTY, reading semantic screen snapshots. A pattern library classifies a screen (REPL, menu, pager, fzf search, confirm dialog, form, spinner, wizard) and drives it with a ready recipe. Use when a program expects a live terminal (arrow-key menus, prompts, spinners, password fields, curses UIs), or when a piped command hangs or prints nothing.
dwgx/SmartCLI · ★ 2 · Web & Frontend · score 71
Install: claude install-skill dwgx/SmartCLI
# drive-tui Drive interactive terminal programs the way a human does: look at the screen, decide, press keys, wait, look again. A normal `subprocess`/pipe can't do this — line-buffered pipes hide menus, spinners, and prompts, and many programs refuse to run without a real TTY. This skill uses `smartcli_core` (a PTY + `pyte` screen model + semantic snapshots + readiness waits) behind a thin CLI, `scripts/tui.py`. ## When to use - Launching a program that draws a full-screen or line-mode UI and expects keystrokes (REPLs, installers, `vim`, agent CLIs, arrow-key menus, y/n prompts, password entry). - A piped command hangs, prints nothing, or says "not a terminal". - You need to see what an interactive program is showing right now, then act on it. - Do NOT use for non-interactive commands whose full output you just want captured — run those directly. ## Core mental model: the perceive → decide → act loop Never fire keystrokes blind and never guess with `sleep`. Every interaction is one turn of this loop: 1. **Perceive** — take a snapshot. Read the header line (cursor position, selected row, status bar, errors) and the row-numbered body. 2. **Decide** — classify the screen: is it a menu, a text prompt, a confirmation, a spinner still loading, an error, or a finished result? Decide the single next action. 3. **Act** — translate intent into key tokens and send them (`send-line`, `send-text`, or `keys`). 4. **Wait** — call `wait` / `wait-regex`. NEVER `sleep`. The wait pumps out