Tmux CLI Driver
Drive terminal validation through programmable tmux sessions.
Session Setup
- Create a detached session with a descriptive name:
tmux new-session -d -s <test-name>. - Use separate windows or panes for isolated processes (server, client, worker).
Command Execution
- Send commands with
tmux send-keys -t <target> '<command>' Enter. - Wait for output readiness with
sleepor by pollingtmux capture-paneuntil a target string appears.
Output Capture
- Capture pane contents:
tmux capture-pane -t <target> -p. - Write captures to temporary files for diffing or grep assertions.
Cleanup
- Kill the session after each test:
tmux kill-session -t <test-name>. - Wrap setup and teardown in a script to ensure isolation even on failure.
Integration
- Combine with Playwright or Cypress by running the tmux-driven CLI as a subprocess and asserting on exported logs or HTTP endpoints.
- Return structured pass/fail results with captured stdout/stderr for CI consumption.