/termwright:termwrightfrom termwright
Drives and tests terminal UI (TUI) apps with the termwright CLI through YAML step files, one-shot screen or PNG capture, or a daemon session. Use when you need to see or interact with a full-screen terminal program (menus, curses, ratatui apps) from Bash, or to write a repeatable TUI test.
Ships in termwright. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Not for browser automation (the playwright-cli skill, if installed) or for developing termwright's Rust library.
termwright runs a program in a pseudo-terminal, sends real keystrokes, reads the screen, and saves artifacts. This skill was checked against termwright 0.2.0. Check cargo search termwright for a newer release, and run termwright --help and termwright info steps|keys|protocols|capabilities when the installed version differs.
| Need | Mode |
|---|---|
| Repeatable check of a state change | termwright run-steps file.yaml |
| One look at a screen | termwright run --wait-for "Ready" -- ./app (add --format json) |
| One PNG | termwright screenshot --wait-for "Ready" -o shot.png -- ./app |
| Explore step by step | daemon plus termwright exec |
One-shot run and screenshot kill the process after capture. Use Read on a PNG to see it.
Assert the transition, not just that text exists. Check the destination is absent first, then present after input:
session:
command: ./build/my-tui
args: []
cwd: .
cols: 100
rows: 30
steps:
- waitForText: {text: "Main menu", timeoutMs: 5000}
- notExpectText: {text: "Settings"}
- press: {key: Down}
- press: {key: Enter}
- expectText: {text: "Settings", timeoutMs: 2000}
- screenshot: {name: settings}
artifacts:
mode: onFailure
dir: ./termwright-artifacts
Run it with termwright run-steps ./test.yaml. Add --trace only when trace output is acceptable. Read step files and artifacts for the schema, assertion semantics, artifact behavior, and --connect.
Start the daemon on a fresh socket in a private directory, then send one exec request at a time and read each JSON reply before the next:
D=$(mktemp -d); SOCK="$D/tw.sock"
termwright daemon --socket "$SOCK" --background -- ./build/my-tui
termwright exec --socket "$SOCK" --method wait_for_text --params '{"text":"Main menu","timeout_ms":5000}'
termwright exec --socket "$SOCK" --method press --params '{"key":"Down"}'
termwright exec --socket "$SOCK" --method screen --params '{"format":"text"}'
termwright exec --socket "$SOCK" --method close
exec exits 0 even when the reply holds an error, so always inspect the JSON. Read daemon and capture before using the daemon.
A zero exit or a sent keystroke doesn't prove the app reached the intended state. Check the screen or artifacts. Report what you observed, artifact paths (not their sensitive contents), cleanup, and unresolved failures.
termwright info steps <name> or info keys instead of retrying the same input.waitForText, waitForIdle) over a longer fixed delay.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub adminhead/claude-plugins --plugin termwright