Headless virtual terminal for AI agents. Spawn interactive terminal apps, read the screen, send keystrokes. No GUI, no X server, no display needed.
tu is to terminal applications what agent-browser is to web pages.
An AI agent playing NetHack — character creation, dungeon exploration, combat — driven entirely through tu:
tu1.mp4
Prebuilt binary (Linux, macOS):
curl -fsSL https://raw.githubusercontent.com/flipbit03/terminal-use/main/install.sh | shFrom source:
cargo install terminal-useTo update:
tu self update# terminal-use (`tu`)
Some programs (htop, vim, mc, dialog-based installers, ncurses UIs) need a real
terminal to render their interface — you can't just pipe stdin/stdout. Use `tu`
to run them in a virtual terminal, screenshot the screen and send keystrokes.
Run `tu usage` before the first interaction for the full command reference.
That's it!
Open a separate terminal and watch what your agent is doing in real time:
tu monitor # Watch the default session
tu monitor --name nethack # Watch a specific session- Full-color terminal rendering inside a framed window
- Left/Right arrows to switch between sessions
- Handles terminal resize
- Ctrl+C to detach
tu wraps a headless PTY + vt100 terminal emulator behind a CLI. A background daemon manages sessions — each CLI invocation is stateless.
tu CLI --> Unix socket (JSON) --> daemon --> PTY + vt100 emulator
The daemon auto-starts on first use and auto-exits after 8 hours of inactivity.
- Terminal size: 120x40
- TERM:
xterm-256color - Session name:
default(unless--namespecified) - Output: Human-readable if TTY, JSON for the agent (non-interactive terminal)
MIT