Agent skill
terminal-emulator
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".
Install this agent skill to your Project
npx add-skill https://github.com/slopus/happy/tree/main/.claude/skills/terminal-emulator
SKILL.md
Testing Interactive CLI / TUI with @microsoft/tui-test
Playwright-like API for terminals. Real PTY per test. Made by Microsoft.
- GitHub: https://github.com/microsoft/tui-test
- npm:
@microsoft/tui-test
Install
yarn add -D @microsoft/tui-test
Usage
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
// 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
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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
office-hours
MANUAL TRIGGER ONLY: invoke only when user types /office-hours. YC Office Hours — two modes. Startup mode: six forcing questions that expose demand reality, status quo, desperate specificity, narrowest wedge, observation, and future-fit. Builder mode: design thinking brainstorming for side projects, hackathons, learning, and open source. Saves a design doc. Use when asked to "brainstorm this", "I have an idea", "help me think through this", "office hours", or "is this worth building". Proactively suggest when the user describes a new product idea or is exploring whether something is worth building — before any code is written.
agent-browser
Browser automation CLI for AI agents. Use this when asked to test something in a real browser.
verl-rl-training
Provides guidance for training LLMs with reinforcement learning using verl (Volcano Engine RL). Use when implementing RLHF, GRPO, PPO, or other RL algorithms for LLM post-training at scale with flexible infrastructure backends.
openrlhf-training
High-performance RLHF framework with Ray+vLLM acceleration. Use for PPO, GRPO, RLOO, DPO training of large models (7B-70B+). Built on Ray, vLLM, ZeRO-3. 2× faster than DeepSpeedChat with distributed architecture and GPU resource sharing.
gguf-quantization
GGUF format and llama.cpp quantization for efficient CPU/GPU inference. Use when deploying models on consumer hardware, Apple Silicon, or when needing flexible quantization from 2-8 bit without GPU requirements.
Claude Code Guide
Master guide for using Claude Code effectively. Includes configuration templates, prompting strategies "Thinking" keywords, debugging techniques, and best practices for interacting with the agent.
Didn't find tool you were looking for?