TUI Inspector
Use this skill to create reproducible TUI video + screenshot artifacts with the
tooling in /dp/tui_inspector.
Quick Start
bash /dp/tui_inspector/scripts/capture_mcp_agent_mail_tui.sh \
--profile analytics-seeded \
--binary /data/tmp/cargo-target/debug/mcp-agent-mail \
--project-dir /data/projects/mcp_agent_mail_rust
Outputs:
- MP4 video at
--output - PNG snapshot at
<output_basename>.png(unless--no-snapshot)
Workflow
- Confirm dependencies:
vhs,ttyd, and optionalffmpeg - Pick a profile (
analytics-empty,analytics-seeded,messages-seeded,tour-seeded) - Run capture with explicit
--binary,--project-dir - Inspect generated PNG first for quick verification
- Share MP4 plus run metadata for full playback context
Why This Is Reliable
- Forces MCP mode (
unset AM_INTERFACE_MODE) - Uses isolated runtime state:
DATABASE_URL='sqlite:///.../storage.sqlite3'and per-runSTORAGE_ROOT - Optional live seeding via MCP HTTP JSON-RPC to avoid empty captures
- Avoids flaky captures from locked/shared local DB files
Commands
List profiles:
bash /dp/tui_inspector/scripts/capture_mcp_agent_mail_tui.sh --list-profiles
Empty-state baseline:
bash /dp/tui_inspector/scripts/capture_mcp_agent_mail_tui.sh \
--profile analytics-empty \
--binary /data/tmp/cargo-target/debug/mcp-agent-mail \
--project-dir /data/projects/mcp_agent_mail_rust
Seeded analytics:
bash /dp/tui_inspector/scripts/capture_mcp_agent_mail_tui.sh \
--profile analytics-seeded \
--binary /data/tmp/cargo-target/debug/mcp-agent-mail \
--project-dir /data/projects/mcp_agent_mail_rust
Seeded messages:
bash /dp/tui_inspector/scripts/capture_mcp_agent_mail_tui.sh \
--profile messages-seeded \
--binary /data/tmp/cargo-target/debug/mcp-agent-mail \
--project-dir /data/projects/mcp_agent_mail_rust
Custom key script:
bash /dp/tui_inspector/scripts/capture_mcp_agent_mail_tui.sh \
--profile analytics-empty \
--keys "#,sleep:6,?,sleep:2,q"
Suite mode:
bash /dp/tui_inspector/scripts/run_mcp_agent_mail_tui_suite.sh \
--profiles analytics-empty,analytics-seeded,messages-seeded \
--suite-name nightly_smoke
Report generation from existing suite:
bash /dp/tui_inspector/scripts/generate_tui_inspector_report.sh \
--suite-dir /tmp/tui_inspector/suites/nightly_smoke
Doctor checks:
bash /dp/tui_inspector/scripts/doctor_tui_inspector.sh
Common Flags
--jump-key "#": switch to analytics screen (legacy alias mode)--boot-sleep 6: wait for TUI boot before keypress--capture-sleep 8: hold legacy jump target before quit--snapshot-second 9: timestamp to extract PNG frame--no-snapshot: skip PNG extraction--seed-demo: enable live JSON-RPC data seeding--seed-messages 12: increase data density--run-name my_case: stable artifact directory name--seed-required: fail run when seeding fails--snapshot-required: fail run when snapshot extraction fails
Operating Modes
Use these explicit modes to avoid accidental misuse:
- Empty-state regression mode:
--profile analytics-emptywhen validating layout/text/chrome behavior independent of data. - Seeded-state behavior mode:
--profile analytics-seededormessages-seededwhen validating data visibility and event-driven changes. - End-to-end smoke mode:
suite runner with
--fail-fastand strict pass-through flags (--seed-required,--snapshot-required). - Forensic mode:
preserve full run artifacts and inspect
run_meta.json,vhs.log, and seeder logs before reruns.
Decision Matrix
Use this fast selection guide:
- Need to verify a static rendering bug quickly:
use single run +
analytics-empty. - Need to prove data does not display:
use
analytics-seededwith--seed-required. - Need confidence across multiple screens:
use suite mode with
tour-seeded. - Need CI signal quality:
use suite mode + strict flags + deterministic
--suite-name.
Artifacts
Each run stores:
capture.tape(exact tape used)vhs.logrun_summary.txtrun_meta.jsoncapture.mp4snapshot.png(unless disabled)seed.log+ stdout/stderr logs when seeding is enabled- suite-level outputs:
suite_summary.txt,suite_manifest.json,report.json,index.html
Default root:
/tmp/tui_inspector/runs/<timestamp>_<profile>/
Metadata Contract
run_meta.json should be treated as the canonical machine-readable outcome.
Core fields to trust:
statusduration_secondsvhs_exit_codeseed_exit_codesnapshot_statusvideo_existssnapshot_existsvideo_duration_seconds
In suite mode, use:
suite_summary.txtfor human quick scansuite_manifest.jsonfor machine consumptionreport.jsonfor report-backed pipelines
Validation
bash /dp/tui_inspector/scripts/capture_mcp_agent_mail_tui.sh --help
bash /dp/tui_inspector/scripts/capture_mcp_agent_mail_tui.sh --list-profiles
bash /dp/tui_inspector/scripts/run_mcp_agent_mail_tui_suite.sh --help
bash /dp/tui_inspector/scripts/generate_tui_inspector_report.sh --help
bash /dp/tui_inspector/scripts/doctor_tui_inspector.sh --help
validate-skill.py /cs/tui-inspector/ --verbose
CI and Automation Defaults
Recommended strict CI invocation:
bash /dp/tui_inspector/scripts/run_mcp_agent_mail_tui_suite.sh \
--profiles analytics-empty,analytics-seeded,messages-seeded \
--suite-name "ci_${GITHUB_RUN_ID:-manual}" \
--fail-fast \
-- --seed-required --snapshot-required
Recommended post-step bundle:
suite_dir="/tmp/tui_inspector/suites/ci_${GITHUB_RUN_ID:-manual}"
tar -czf "${suite_dir}.tar.gz" -C "$(dirname "$suite_dir")" "$(basename "$suite_dir")"
Anti-Patterns
- Running seeded profiles without
--seed-requiredwhen outcome strictness matters. - Comparing screenshots without retaining
run_meta.jsonandvhs.log. - Reusing ambiguous run names in CI.
- Treating a passing MP4 generation as success when
seed_exit_codefailed. - Skipping doctor checks after dependency or environment changes.
Fast Incident Workflow
- Run doctor:
bash /dp/tui_inspector/scripts/doctor_tui_inspector.sh - Run single strict seeded capture:
capture_mcp_agent_mail_tui.sh --profile analytics-seeded --seed-required --snapshot-required - If failure:
inspect
run_meta.jsonfirst, thenvhs.log, thenseed.stderr.log. - Run minimal suite for blast-radius check:
analytics-empty,messages-seeded. - Generate report and attach bundle to issue/PR.
Preserved Baseline Content
The following baseline content is intentionally preserved (reorganized only):
- Quick-start capture command for analytics
- Output contract (
--output,<output_basename>.png) - Workflow checklist (deps, run, inspect PNG, share MP4)
- Reliability rationale (MCP mode + isolated runtime state)
- Common flags (
--jump-key,--boot-sleep,--capture-sleep,--snapshot-second,--no-snapshot) - Validation command pattern
References
- Operational playbook: PLAYBOOK.md
- Suite/report cookbook: SUITE_AND_REPORT.md
- Failure triage map: TROUBLESHOOTING.md
- Mode selection matrix: MODE_SELECTION.md
- CI contract: CI_CONTRACT.md
- Anti-pattern catalog: ANTI_PATTERNS.md
- Forensics handbook: FORENSICS.md
- Command catalog: COMMAND_CATALOG.md
Reference Index
- PLAYBOOK.md
- SUITE_AND_REPORT.md
- TROUBLESHOOTING.md
- MODE_SELECTION.md
- CI_CONTRACT.md
- ANTI_PATTERNS.md
- FORENSICS.md
- COMMAND_CATALOG.md