testingterm
These docs were written by an AI agent. They were checked against the code, but may still contain mistakes; when in doubt, trust testingterm --help and the types.

Introduction

A fast headless terminal your agent (or your CI) uses to test terminal apps.

testingterm runs a program inside a real terminal emulator that nobody has to look at, and gives you full control over it: send keys, type, click at pixel coordinates, read the screen with its colors, and save screenshots, videos and performance profiles of what happened.

It is built for two kinds of users:

  • Coding agents that need to check whether a CLI or TUI they changed actually works, and show a human the evidence.
  • Test suites that want end to end tests for terminal programs, locally and in CI.

How it works

Each terminal is a small native engine built on libghostty, the terminal core of Ghostty. The engine runs your program in a pseudo terminal, parses its output exactly like a desktop terminal would, and draws frames itself on the CPU. Nothing needs a display or a GPU, which is why it runs the same on a laptop, a Linux server and a CI runner.

A JavaScript library and a CLI drive the engine:

  • The library (import { launch } from "testingterm") is what tests and scripts use.
  • The CLI runs those scripts (testingterm run) and can also drive a terminal one command at a time (testingterm new, screen, press, click, ...), which suits agents exploring an app they don't know yet.

Speed

A launch, a wait for text and a screenshot take tens of milliseconds, so a whole testingterm run of a trivial script finishes in well under 100ms on a normal machine. Waits never poll: the engine resolves them the moment the screen matches.

What's in these docs