Run Command
Record a shell script to MP4/WebM using the high-performance native canvas renderer.
slides-tape run demo.sh -o demo.mp4 --speed 1.5 --font-size 18
| Option | Description | Default |
|---|---|---|
-o, --output <path> | Output file path | <script>.mp4 |
-r, --resolution <WxH> | Video resolution | 1920x1080 |
-f, --fps <fps> | Framerate | 30 |
--fast | Fast preview mode | false |
--format <fmt> | mp4 | webm | mp4 |
--speed <n> | Playback speed multiplier | 1 |
--cols / --rows <n> | Terminal dimensions | 120x30 |
--ps1 <prompt> | Shell prompt string | "$ " |
--font-size <px> | Font size (Canvas only) | 14 |
--font-family <name> | Font family (Canvas only) | "JetBrains Mono" |
--load-events <path> | Render from a .tre file | - |
--skip-idle <ms> | Collapse idle gaps > ms | - |
--highlight-cmds | Visual flash on command start | - |
--no-save-events | Disable auto-saving .tre | - |
--keep-frames | Keep raw PNG files | - |
๐๏ธ Deterministic Runner
Starting with v2.1.0, the run command uses a two-phase execution loop:
- The Capture Phase: Your script runs in a native Unix PTY while the engine records raw ANSI sequence timestamps into a
.trefile. - The Render Phase: The
.trefile is pushed through the@napi-rs/canvasengine to compile frames at a perfect, constant framerate, regardless of system load during execution.
๐ป Terminal Directives
You can embed special automation directives inside your bash run scripts to control execution, simulate typing, and wait for conditions.
| Directive | Description |
|---|---|
# @type "cmd" | Simulates human typing. |
# @wait <time> | Pause (e.g., 2s, 500ms, or auto). |
# @await port <n> | Polls until TCP port is open (max 30s). |
# @await file <path> | Polls until file exists (max 30s). |
# @await http <url> | Polls until HTTP 200 (max 30s). |
# @hide / # @show | Run commands invisibly in the background. |
# @echo off / # @echo on | Execute visibly, but donโt show the typing phase. |
# @clear | Clear terminal screen. |
# @title "label" | Change the macOS-style terminal title bar. |
# @print "text" | Inject raw text/ANSI directly into stream. |
# @ps1 "prompt" | Change shell prompt on-the-fly (supports ANSI). |