Agent skill

Interactive CLI Testing With tui-test

by slopus in slopus/happy

Tests interactive CLI and TUI programs with Microsoft's tui-test, driving prompts, arrow keys and screen output in a real pseudo-terminal.

MITAuto-check passedTesting & QA

Install Interactive CLI Testing With tui-test

skills CLI
$ npx skills add slopus/happy --skill terminal-emulator -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install slopus/happy terminal-emulator --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/slopus/happy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/terminal-emulator .claude/skills/terminal-emulator && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
terminal-emulator
GitHub stars
24k
Token cost
~603 tokens
SKILL.md length
50 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

Tests interactive CLI and TUI programs with Microsoft's tui-test, driving prompts, arrow keys and screen output in a real pseudo-terminal.

  • Testing a CLI with interactive prompts
  • SKILL.md covers Install, Usage, API and Running, plus 1 more section
  • Calls npx and yarn
  • Checking TUI rendering with snapshot tests

What it does

This skill points the agent to @microsoft/tui-test, a Playwright-like library for terminals that gives each test a real PTY. It is meant for CLI tools with interactive prompts, TUI rendering, arrow-key navigation or any command that needs a TTY. Tests are written in TypeScript, using test.use to name the program and its arguments, and a terminal object lets them write keystrokes such as the arrow-up and arrow-down escape sequences.

Tests run with npx tui-test, with options to update snapshots or run a single file. The library waits for terminal renders on its own, has built-in snapshot testing and works on macOS, Linux and Windows. The package is added as a dev dependency with yarn, and the skill's allowed tools are limited to npx tui-test and node commands.

When your agent uses it

  • Testing a CLI with interactive prompts
  • Checking TUI rendering with snapshot tests
  • Simulating arrow-key navigation in a terminal program
  • Automating terminal input for a command that needs a TTY

Example prompts

  • “Write a tui-test that selects the second option in our init wizard with the arrow keys.”
  • “Add snapshot tests for the TUI screen of our dashboard command.”
  • “Test that my-cli.js asks for a project name and exits cleanly on Ctrl+C.”

Requirements

  • Node.js
  • @microsoft/tui-test installed as a dev dependency
  • Pre-approved tools (allowed-tools): Bash(npx tui-test:*), Bash(node:*)

What it can do on your machine

Read from SKILL.md and the folder at commit fba320e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(npx tui-test:*)
    • Bash(node:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • yarn

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Interactive CLI Testing With tui-test loads about 603 tokens when it runs. Until then it costs about 85 tokens; SKILL.md has 50 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~85
When it runs · the whole SKILL.md, loaded when a task matches
~603

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from slopus/happy at commit fba320e, republished under its MIT licence (© slopus). 50 words, ~603 tokens.

Download SKILL.mdSave it as .claude/skills/terminal-emulator/SKILL.md (or your agent's skills folder).
name
terminal-emulator
description
Test interactive CLI/TUI applications using @microsoft/tui-test. Use when you need to test CLI tools with interactive prompts, TUI rendering, arrow key navigation, or any command that requires a TTY. Triggers include "test CLI", "test TUI", "run interactively", "automate terminal input", "simulate user input in terminal".
allowed-tools
Bash(npx tui-test:*), Bash(node:*)

Testing Interactive CLI / TUI with @microsoft/tui-test

Playwright-like API for terminals. Real PTY per test. Made by Microsoft.

Install

bash
yarn add -D @microsoft/tui-test

Usage

typescript
import { test, expect } from '@microsoft/tui-test';

test.use({ program: { file: 'node', args: ['./my-cli.js'] } });

test('selects option and proceeds', async ({ terminal }) => {
    await expect(terminal.getByText('Select an option')).toBeVisible();
    await terminal.write('\x1B[B');  // Arrow Down
    await terminal.submit();          // Enter
    await expect(terminal.getByText('Option 2 selected')).toBeVisible();
});

test('matches snapshot', async ({ terminal }) => {
    await expect(terminal).toMatchSnapshot();
});

API

typescript
// Navigation
await terminal.write('\x1B[A');    // Arrow Up
await terminal.write('\x1B[B');    // Arrow Down
await terminal.write('\x1B[C');    // Arrow Right
await terminal.write('\x1B[D');    // Arrow Left
await terminal.submit();           // Enter
await terminal.write('\t');        // Tab
await terminal.write('\x03');      // Ctrl+C
await terminal.write('\x1B');      // Escape
await terminal.write('\x7F');      // Backspace
await terminal.write('hello');     // Type text

// Assertions
await expect(terminal.getByText('pattern')).toBeVisible();
await expect(terminal.getByText('pattern', { full: true })).toBeVisible();
await expect(terminal).toMatchSnapshot();

// Reading
const content = terminal.content;  // Full terminal content as string

Running

bash
npx tui-test                       # Run all tests
npx tui-test --update-snapshots    # Update snapshots
npx tui-test my-test.ts            # Run specific test

Reference

  • Used by VS Code terminal team
  • Real PTY isolation per test (no mocking)
  • Auto-waits for terminal renders
  • Cross-platform (macOS, Linux, Windows)
  • Snapshot testing built-in

© slopus, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/terminal-emulator of slopus/happy.

Open the folder on GitHubat commit fba320e

Compare with similar skills

Interactive CLI Testing With tui-test next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Interactive CLI Testing With tui-test compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Interactive CLI Testing With tui-test this skillslopus/happy24k—~603Automated safety check: PassMIT
OpenHarness End-to-End EvalsHKUDS/OpenHarness16k1 repos~2.1kAutomated safety check: NotesMIT
Java SDK E2E Test with Replay Snapshotgithub/copilot-sdk11k—~1.8kAutomated safety check: PassMIT
ClickUp CLI Testingkrodak/clickup-cli121—~1.4kAutomated safety check: NotesMIT
Growing Outside In Systemslexler/skill-factory2391 repos~1.9kAutomated safety check: PassApache-2.0
Testing Strategiesancoleman/ai-design-components526—~3.8kAutomated safety check: PassMIT

Similar skills

  • Validates OpenHarness features by running real multi-turn agent loops with live LLM calls against an unfamiliar codebase, checking actual tool execution.

    16k GitHub starsUsed in 1 repo~2.1k tokens
    Testing & QAAuto-check: notes
  • Official

    Creates a Java SDK end-to-end test for the Copilot SDK that runs against a recorded YAML snapshot through a replay proxy, so CI needs no real authentication.

    11k GitHub stars~1.8k tokensUpdated today
    Testing & QAAuto-check passed
  • ClickUp CLI Testing

    krodak/clickup-cli

    Explains how to run and extend the clickup-cli tests: unit tests with a mocked client, e2e tests against a real ClickUp workspace, and the fixture data they rely on.

    121 GitHub stars~1.4k tokensUpdated 3 days ago
    Testing & QAAuto-check: notes
  • Growing Outside In Systems

    lexler/skill-factory

    Drive feature development using Outside-In TDD with Hexagonal Architecture.

    239 GitHub starsUsed in 1 repo~1.9k tokens
    Testing & QAAuto-check passed
  • Testing Strategies

    ancoleman/ai-design-components

    Strategic guidance for choosing and implementing testing approaches across the test pyramid.

    526 GitHub stars~3.8k tokensUpdated 10 mo ago
    Testing & QAAuto-check passed
  • Angular Testing

    Kilo-Org/kilo-marketplace

    Write unit and integration tests for Angular v20+ applications using Vitest or Jasmine with TestBed and modern testing patterns.

    190 GitHub stars~2.9k tokensUpdated 11 days ago
    Testing & QAAuto-check passed

More from slopus/happy

All 8 skills in this repo
  • Searches past Claude Code, Codex and Cursor sessions and summarizes what was worked on, tried or decided, using extraction scripts instead of reading raw logs.

    24k GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • Agent Browser CLI

    slopus/happy

    Drives a real browser from the shell with the agent-browser CLI: open pages, snapshot elements by ref, click, fill and extract, for testing web flows.

    24k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Traces how an action moves through your code and draws it as a compact ASCII tree: functions called, payload types, state changes and components that re-render.

    24k GitHub stars~654 tokensUpdated today
    Auto-check passed
  • Local development guide for the Happy pnpm monorepo: install, build, test and run the CLI, server, Expo app and Tauri desktop packages.

    24k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Queries live Prometheus metrics and manages Grafana dashboards as code for Happy's infrastructure, using the grafanactl CLI and the Grafana datasource proxy API.

    24k GitHub stars~2k tokensUpdated today
    Auto-check: notes
  • Walks you through releasing a component of the Happy monorepo (CLI, mobile, web or server) from a clean local main that matches origin/main.

    24k GitHub stars~6.6k tokensUpdated today
    Auto-check passed

Works with

Questions about Interactive CLI Testing With tui-test

What does Interactive CLI Testing With tui-test do?

Tests interactive CLI and TUI programs with Microsoft's tui-test, driving prompts, arrow keys and screen output in a real pseudo-terminal. This skill points the agent to @microsoft/tui-test, a Playwright-like library for terminals that gives each test a real PTY. It is meant for CLI tools with interactive prompts, TUI rendering, arrow-key navigation or any command that needs a TTY.

When should I use Interactive CLI Testing With tui-test?

Interactive CLI Testing With tui-test fits situations like: testing a CLI with interactive prompts; checking TUI rendering with snapshot tests; simulating arrow-key navigation in a terminal program; automating terminal input for a command that needs a TTY.

How do I install Interactive CLI Testing With tui-test in Claude Code?

Run `npx skills add slopus/happy --skill terminal-emulator -a claude-code`. Or copy the skill folder (.agents/skills/terminal-emulator in slopus/happy) into .claude/skills/terminal-emulator in your project. Claude Code loads it when a task matches its description.

How do I install Interactive CLI Testing With tui-test in Codex?

Run `npx skills add slopus/happy --skill terminal-emulator -a codex`. Or copy the skill folder (.agents/skills/terminal-emulator in slopus/happy) into .agents/skills/terminal-emulator in your project. Codex loads it when a task matches its description.

Can I use Interactive CLI Testing With tui-test in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add slopus/happy --skill terminal-emulator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/terminal-emulator, .gemini/skills/terminal-emulator, .github/skills/terminal-emulator and .opencode/skills/terminal-emulator in your project.

What does Interactive CLI Testing With tui-test need to run?

Going by SKILL.md and its folder, Interactive CLI Testing With tui-test needs the command-line tools its instructions call (npx and yarn). Our summary lists: Node.js; @microsoft/tui-test installed as a dev dependency. Its frontmatter pre-approves these tools: Bash(npx tui-test:*), Bash(node:*).

Does Interactive CLI Testing With tui-test access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Interactive CLI Testing With tui-test safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Interactive CLI Testing With tui-test use?

Interactive CLI Testing With tui-test is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Interactive CLI Testing With tui-test use?

About 603 tokens (SKILL.md is roughly 2.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Interactive CLI Testing With tui-test?

Skills that share tags, products or a category with Interactive CLI Testing With tui-test: OpenHarness End-to-End Evals (HKUDS/OpenHarness, 16k stars), Java SDK E2E Test with Replay Snapshot (github/copilot-sdk, 11k stars), ClickUp CLI Testing (krodak/clickup-cli, 121 stars) and Growing Outside In Systems (lexler/skill-factory, 239 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Interactive CLI Testing With tui-test?

slopus (a GitHub organization) maintains it in slopus/happy, which has 24,066 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 9, 2026.

Source: slopus/happy on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.