Open-source tool spawns programs in a PTY, exposes screen state as text, and sends keystrokes — giving AI agents control over REPLs, debuggers, and TUI apps.
A developer released tui-use, an open-source CLI tool that wraps any interactive terminal program in a PTY (pseudo-terminal), allowing AI agents to read screen output as plain text and send keystrokes programmatically. It solves a critical gap where agents like Claude Code, Cursor, and Codex get stuck when programs require interactive keyboard input — debuggers at breakpoints, Python REPLs mid-session, or full-screen TUI apps like vim and lazygit. Unlike tmux send-keys, tui-use signals when a program has finished responding, eliminating the need for arbitrary sleep timers or polling loops. A prebuilt binary is available with auto-build fallback from source.
tui-use closes the most frustrating gap in AI coding agent workflows: interactive programs that block on keyboard input. Concretely, you can now drop Claude Code into a live pdb session with gigabytes of in-memory state, let it set breakpoints and inspect variables, and get output back — without restarting the process or dumping state to disk. The PTY wrapper correctly signals program completion, so agents don't need sleep hacks or polling loops that cause them to misread partial output.
Clone tui-use this week and wire it into your Claude Code setup to debug a long-running Python process — measure how many round-trips it takes the agent to identify a bug vs. your current one-shot script approach.
Suggested exercise · not independently tested. Access requirements and costs may vary.
Run: git clone https://github.com/[tui-use-repo] && cd tui-use && ./install.sh to get the binary
Start a Python REPL via tui-use: tui-use python3 — then from your agent or shell, send keystrokes: tui-use send 'import sys; print(sys.version)' and press Enter
Run tui-use read to capture the current screen buffer as plain text and verify the agent sees the REPL output
Tags
Sources