testingterm

A terminal for agents to test terminal apps

Run any CLI or TUI in a real headless terminal, press keys, click, read the screen, and get back screenshots, videos and profiles. Script it in one call, or drive it step by step.

$curl -fsSL https://testingterm.com/install | sh
0:00 / 0:09

This video was recorded by testingterm while the script below ran.

Write a script

Assertions wait for the screen instead of sleeping, and text locators click the right cell. Run it and get the results, plus every screenshot and video, in one call.

check.mjs
import { launch, expect } from "testingterm";

const term = launch("node ship.mjs");
await expect(term).toHaveText("3 of 4 up");
await term.press("/");
await term.type("api");
await term.getByText("Deploy").click();
await expect(term).toHaveText("shipped api");
await term.screenshot();
$ testingterm run check.mjs --video on
✓ check.mjs (84ms)
    ./check/ship-01.png
    ./check/ship.mp4
$ testingterm run -e '
    const t = launch("ls")
    await expect(t).toHaveText("package.json")
    await t.screenshot()'

It is fast: a trivial run that launches a program, waits for its output and takes a screenshot finishes in well under 100ms.

testingterm run <file>runs test scripts and prints results, screenshots and videos
testingterm run -e '<code>'runs a script inline, in one call
testingterm new -- <command>starts a program in a terminal you drive step by step
testingterm screenprints the screen's text, cursor and modes
testingterm press / typesends keys and text like a person at a keyboard
testingterm click <x> <y>clicks a pixel, a cell, or --text on screen
testingterm wait --text <t>waits for text, a steady screen, quiet, or exit
testingterm screenshotsaves a pixel-exact PNG
testingterm record start|stoprecords an MP4 with the pointer and keys drawn in
testingterm profile start|stoprecords output timing, CPU and memory for Perfetto
testingterm verify <claim>experimental: Claude Code or Codex checks the screen
testingterm setupinstalls the skill that teaches agents to use testingterm
testingterm upgradeupgrades to the latest release

How does it work?

testingterm runs your program on a pty inside libghostty, the terminal core of Ghostty, and draws the screen itself, so screenshots and videos are exact and need no display. Add --headed to watch a run in a window.