Capture PNG screenshots of dex TUI commands for debugging UI layout issues. Use when iterating on CLI interface code or debugging rendering problems.
Capture screenshots of dex TUI commands using vhs.
Run the screenshot tool with a dex command:
./tools/screenshot.sh "<command>" [options]
Read the output file to view the captured TUI:
# Default output is /tmp/dex-screenshot.png
Use the Read tool on the PNG file to see the rendered UI.
-o, --output <path> - Output PNG path (default: /tmp/dex-screenshot.png)-k, --keys <keys> - Key sequence to send after initial load (comma-separated)-w, --wait <seconds> - Initial wait time in seconds (default: 10)--no-open - Don't open the screenshot after captureUse -k to navigate through screens. Supported keys:
enter - Press Enter (navigate into views)esc - Press Escape (go back)j, k - Navigate up/downg, G - Go to top/bottom# Screenshot list view (search results)
./tools/screenshot.sh "search api"
# Screenshot matches view (press Enter to expand first result)
./tools/screenshot.sh "search api" -k enter
# Screenshot conversation view (Enter twice)
./tools/screenshot.sh "search api" -k enter,enter
# Screenshot with navigation (go to matches, scroll down twice)
./tools/screenshot.sh "search api" -k enter,j,j
# Custom output path
./tools/screenshot.sh "search api" -o /tmp/api-search.png -k enter
# Don't auto-open (useful for automation)
./tools/screenshot.sh "list" --no-open
The search command has 4 views:
-k enter)-k enter,enter)-k enter,enter,enter)src/cli/commands/Requires vhs: brew install vhs