Terminal Apps Need a DOM ConductorOne released agent-tui, an open-source tool that gives terminal applications a queryable DOM-like interface for AI agents. The tool runs programs on a PTY, exposes rendered screens as text with stable references, and enables agents to snapshot, type, and wait for named states. It solves the problem of AI tools needing to parse terminal output designed for humans. When we were building Squire https://www.c1.ai/blog/squire-agentic-first-ephemeral-dev-environments-at-conductorone , C1's software factory, we hit a slightly absurd problem: the AI tools were also built for humans. Squire could give an agent work. But Claude Code, Codex, Pi, and similar AI harnesses present themselves as terminal apps first. Their live interface is a TUI made for a person: a prompt, a streaming response, approval screens, file-change panes, and a cursor waiting for the next instruction. Another agent can type into that interface. It still needs to know whether the response is done, whether an approval screen appeared, or whether the cursor has returned to the prompt. That is the problem agent-tui solves. It runs the target program on a PTY, keeps the terminal state alive in a daemon, exposes the rendered screen as text or an outline with stable refs, and lets a client snapshot, press keys, and wait for named screen state. It gives terminal apps the same kind of queryable surface that made browser automation useful. agent-tui is open source.We are publishing it under the Apache-2.0 license at github.com/ConductorOne/agent-tui . The design comes from our experience with agent-browser : give the agent something it can query instead of a pile of pixels. agent-tui applies that idea to terminal apps. One common Squire pattern is an orchestration agent: a coding harness receives the assignment, then drives another harness to do the work. In this demo, OpenAI's Codex uses agent-tui to drive the Pi harness https://pi.dev/ through a real terminal session. Agents driving agents agents-driving-agents agent-tui starts the outer Codex TUI, waits for @codex.input , types the task, and presses enter. Codex then runs the command sequence below, which starts a second agent-tui daemon around Pi. The Pi side is just another agent-tui session: agent-tui daemon run agent-tui spawn -- pi --offline --no-extensions --no-context-files --no-skills agent-tui wait --ref '@pi.input' agent-tui type --to '@pi.input' 'Reply with the token formed by joining INNER, AGENT, and OK with .' agent-tui press --to '@pi.input' '