driving-the-tui

Drives and validates the GAIA TUI through its loopback control API with screenshots, recordings, and diagnostics.

1.6k|168|Updated Dec 16, 2024
One-click install
npx skills add https://github.com/amd/gaia --skill driving-the-tui-amd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: driving-the-tui
Source: https://github.com/amd/gaia/tree/main/.claude/skills/driving-the-tui
Command: npx skills add https://github.com/amd/gaia --skill driving-the-tui-amd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Testing a terminal UI by hand is slow and error-prone, and naive automation produces false passes — sleeping instead of waiting, scrolling content that fits the window, or clicking where no link exists. This Skill teaches how to actually operate the GAIA TUI end to end through its loopback control API so test results reflect real behavior. ## Core Features & Use Cases - Full remote control: Send keys, text, and mouse events (click, scroll, double-click) to a live TUI session via authenticated HTTP endpoints, and resize the terminal before capturing. - Visual proof: Capture the current frame as SVG screenshots or replay the session as a looping animated SVG recording, with frame-level history for clipping specific actions. - State-based waiting and diagnostics: Block server-side on screen content or state conditions instead of sleeping, and read state.chat diagnostics (scroll position, mouse ownership, viewport size) to distinguish real defects from mis-aimed tests. - Use Case: Validate that a new chat feature renders correctly by launching an isolated TUI with its own daemon and throwaway memory database, sending a query, waiting for the response, and capturing an SVG recording of the session. ## Quick Start Launch the GAIA TUI with a control port and isolated GAIA_TUI_HOME, GAIA_DAEMON_HOME, and GAIA_MEMORY_DB paths, then use the control API to resize, send a query, wait for the response, and capture an SVG screenshot.

Frequently Asked Questions about driving-the-tui

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate testing of a terminal UI application?

Use the GAIA TUI's loopback control API, which exposes HTTP endpoints for sending keys, text, and mouse events, reading the screen, and blocking on state conditions. Launch the TUI with --control-port and authenticate with the bearer token from control.json.

How do I capture screenshots of a terminal application?

Request GET /control/v1/screen?format=svg from the control API to get an exact SVG rendering of the current frame, or use /control/v1/recording for an animated SVG of recent frames. SVG avoids font and rasterizer dependencies.

Why does my TUI test pass but the feature is actually broken?

Tests pass vacuously when preconditions are missing, such as scrolling content that fits the viewport or clicking where no link exists. Assert preconditions like content_rows > viewport_rows first, and run negative cases to prove the gate works.

Why does the TUI render without colors or syntax highlighting?

Launching through bare cmd.exe lands in legacy conhost, which reports no color support, so the TUI emits zero ANSI escape sequences. Launch through Windows Terminal (wt.exe) and verify by counting escape characters in screen?format=ansi output.

How do I avoid polluting user data when testing an AI agent TUI?

Set GAIA_MEMORY_DB to a throwaway file, plus GAIA_DAEMON_HOME and GAIA_TUI_HOME to temporary directories, before every drive. This isolates the test session from the user's real memory database and running daemon.