tui-acceptance-checks

Drives CLI programs through tmux panes and asserts on captured output.

Updated Oct 15, 2021
One-click install
npx skills add https://github.com/toqoz/config --skill tui-acceptance-checks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tui-acceptance-checks
Source: https://github.com/toqoz/config/tree/main/home/agents/skills/tui-acceptance-checks
Command: npx skills add https://github.com/toqoz/config --skill tui-acceptance-checks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires tmux, python3, and includes scripts (resource) components.

What problem does it solve?

This skill solves the difficulty of testing interactive command-line interfaces that rely on TTY behavior, cursor control, and complex key sequences which standard unit tests cannot reach.

Core Features & Use Cases

  • Tmux-based Driving: Uses tmux panes to simulate real user interaction, including key chords and signal handling.
  • Deterministic Assertions: Captures pane content with exponential backoff to verify TUI state changes reliably.
  • Use Case: Use this to verify that a new TUI-based configuration tool correctly handles Ctrl-C interrupts and redraws its interface without crashing.

Quick Start

Use the tui-acceptance-checks skill to initialize a new test session for the target CLI tool and verify its interactive prompt behavior.

Frequently Asked Questions about tui-acceptance-checks

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

FAQPage Schema
How do I automate testing for interactive CLI tools and TUI applications?

You can automate interactive CLI testing by driving programs through tmux panes, simulating real user key chords, and asserting on captured pane content. This approach reaches full-screen UI redraws and signal handling that standard subprocess testing cannot access.

How do I test TUI key bindings and signal handling like Ctrl-C interrupts?

Testing TUI key bindings and signal handling involves simulating user interaction within a tmux pane to send specific key sequences like Ctrl-C. You then capture the pane output to verify the interface redraws correctly without crashing.

Does tmux work for testing full-screen TUI redraws and asynchronous output?

Yes, tmux works for testing full-screen TUI redraws by capturing pane content with exponential backoff. This polling mechanism ensures deterministic assertions on asynchronous content changes and complex TUI state transitions.

What is the best way to verify TTY behavior and cursor control in command-line interfaces?

The best way to verify TTY behavior and cursor control is using tmux-based driving to simulate real terminal interaction. This bypasses standard unit tests, directly testing complex key sequences and TTY-dependent cursor control within a managed session lifecycle.

Why does standard subprocess testing fail to reach interactive command-line interfaces?

Standard subprocess testing fails to reach interactive command-line interfaces because it cannot simulate TTY behavior, cursor control, or complex key sequences. Interactive CLIs require a real terminal environment, which tmux panes provide for accurate simulation.

Do I need Python and tmux to run acceptance checks on interactive CLI programs?

Yes, you need Python 3 and tmux installed to run these acceptance checks. The skill relies on shell-based helper functions and Python scripts to manage the tmux session lifecycle, capture pane content, and perform asynchronous polling.