Skip to content

Packages and exports

Start with the umbrella package:

Terminal window
npm install --save-dev termwright

It provides the test command, Runner, and the imports used by most test suites.

ImportUse
termwright/testTests, assertions, fixtures, configuration, retries, and snapshots
termwrightTerminal sessions, locators, actions, and error types for custom helpers
termwright/inkInk component-test helpers
termwright/gherkinGherkin setup and step definitions
termwright/cliInvoke the CLI from a Node.js program

Application tests should prefer these entry points over individual internal packages. Do not import package src/ or dist/ paths.

termwright/gherkin/runtime and termwright/host support integrations built around Termwright. They are not needed in an ordinary test suite.

Install a probe only when you want semantic locators for that framework. The probe runs with the application and observes its rendered component tree.

FrameworkProbeOptional application annotations
Ink@termwright/probe-ink@termwright/ink
OpenTUI@termwright/probe-opentui@termwright/opentui
TextualPython termwright packagetermwright.textual
tview@termwright/probe-tviewGo annotate package
Ratatuitermwright-probe-ratatuitermwright-ratatui
Bubble Tea@termwright/probe-charmGo annotate package

The annotations are optional. Add them only when the framework’s built-in component information does not express a role, accessible name, relationship, or piece of application state needed by a test.

Follow the setup page for your framework under Framework integrations. The compatibility table there also shows which versions and pointer operations are supported.

Packages such as @termwright/driver, @termwright/protocol, and @termwright/evidence-provider are published for framework and tooling authors. Their generated API reference is useful when building an integration, but they are not extra installation choices for application testing.

Native PTY packages are installed as optional dependencies for the current operating system and architecture. Do not select one manually. If the matching native package is missing or cannot load, npx termwright doctor reports the problem rather than switching to a less accurate fallback.