-
Notifications
You must be signed in to change notification settings - Fork 0
ht (headless terminal) is an open-source Rust binary that wraps any CLI program in a pseudo-terminal (PTY) and exposes the terminal's rendered screen state as JSON over stdin/stdout. It runs on macOS and Linux. The project was created by Andy Konwinski and has approximately 900 GitHub stars, last updated in May 2026.
The motivating use case is LLM agents that need to drive interactive terminal programs — the same problem a headless browser solves for web pages, applied to terminals. Without ht, an agent receiving raw terminal output must parse VT100 escape sequences and track cursor state itself. With ht, the agent observes a rendered snapshot of the terminal screen — the same view a human would see — and sends input as JSON keystrokes.
agent → {"type": "input", "payload": "ls\r"} → ht → bash (PTY)
agent ← {"type": "output", "payload": "rendered screen..."} ← ht
The PTY layer ensures the wrapped program behaves interactively: colors, prompts, cursor movement, and screen state all work as if a human were at the keyboard.
Placed in Tools / Assess / inner.
ht addresses a concrete gap in AI agent workflows: interactive CLI tools (REPLs, TUI editors, SSH sessions, interactive installers) are opaque to agents that receive only raw stdout. The rendered-screen-as-JSON model makes any terminal application agent-addressable with no modifications to the underlying program.
The tool is minimal and well-scoped — a single binary with a clear JSON protocol, no framework dependency, cargo install as the setup path. Applicability extends beyond LLM agents to automated testing of TUI applications and programmatic terminal screen-scraping.
Inner position reflects direct applicability to any Claude Code or agentic workflow needing to drive interactive CLIs, single-binary install, active maintenance, and a clearly defined problem with no established alternative. The modest star count (900) is the primary remaining uncertainty — community breadth is limited relative to the problem's importance.
Trial gate: ht used to drive at least one interactive CLI tool from an LLM agent or automated test, with the rendered screen state used as the observation input for the agent's next action.