From atum-workflows
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".
npx claudepluginhub arnwaldn/atum-plugins-collection --plugin atum-workflowsThis skill is limited to using the following tools:
Playwright-like API for terminals. Real PTY per test. Made by Microsoft.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Playwright-like API for terminals. Real PTY per test. Made by Microsoft.
@microsoft/tui-testyarn add -D @microsoft/tui-test
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();
});
// 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
npx tui-test # Run all tests
npx tui-test --update-snapshots # Update snapshots
npx tui-test my-test.ts # Run specific test