Overview
Tape scripts allow you to:- Automate workflows: Replay complex terminal operations with a single command
- Test integrations: Verify TUIOS behavior in CI/CD pipelines
- Create demos: Generate consistent presentations and tutorials
- Document processes: Capture and share terminal workflows as executable code
- Remote execution: Run scripts against live TUIOS sessions
Quick Start
Running Tape Scripts
Your First Tape Script
Createhello.tape:
Core Concepts
Modes
TUIOS has two primary modes that determine how input is handled:Window Management Mode
For managing windows, workspaces, and layouts:Terminal Mode
For sending input to the focused terminal:Timing
Add pauses to let operations complete:500ms- Milliseconds2s- Seconds1.5s- Decimal seconds1m- Minutes
Command Reference
Window Operations
Workspace Management
Layout & Tiling
Keyboard Input
Requires Terminal Mode:Synchronization
Complete Examples
Development Environment Setup
Multi-Workspace Project
Conditional Waiting
Advanced Features
Remote Execution
Execute tape scripts against a running TUIOS session:Differences: play vs exec
| Feature | tape play | tape exec |
|---|---|---|
| Starts TUIOS | Yes | No (requires running session) |
| Shows TUI | Yes | No (progress bar only) |
| Interactive | Yes | No |
| For automation | No | Yes |
| Session persistence | No | Yes (works with daemon) |
Comments & Documentation
String Literals
Supports multiple quote styles:Best Practices
1. Always Add Sleep After Actions
Give TUIOS time to process:2. Explicit Mode Switching
Always switch modes before mode-specific actions:3. Use Consistent Timing
- Window creation: 500ms
- Window navigation: 200ms
- Animations: 300ms
- Workspace switches: 400ms
4. Document Complex Workflows
5. Handle Long Operations
Use longer timeouts for slow operations:Use Cases
CI/CD Testing
Test TUIOS workflows in continuous integration:Demo Creation
Create consistent, repeatable demos:Onboarding & Training
Share executable workflows with new team members:Documentation
Embed tape scripts in docs for interactive examples.Troubleshooting
Script Not Working?
- Check mode: Ensure you’re in the correct mode
- Add delays: Increase
Sleepdurations - Validate syntax: Run
tuios tape validate script.tape - Test regex: Verify
WaitUntilRegexpatterns match expected output
Common Errors
“Unknown command”Check spelling and capitalization (commands are case-sensitive) “Unexpected token”
Check for missing quotes around strings “Timeout waiting for pattern”
Increase timeout or verify regex pattern
See Also
- Tape Recording - Record live sessions to tape files
- CLI Reference - Complete tape command reference
- GitHub Examples - Real-world tape scripts