Tape files
A tape file describes one terminal capture session. It lists outputs, startup settings, terminal actions, waits, checkpoints, and metadata in the order Betamax should execute them.
File structure
Section titled “File structure”Most tapes divide into three parts:
- Outputs, requirements, environment, and startup settings.
- Ordered terminal actions such as typing, key presses, and waits.
- Optional screenshots, state captures, hidden cleanup, and shell exit.
Output examples/output/basic.gifRequire printf
Set Shell "bash"Set Theme "Aardvark Blue"Set Width 900Set Height 480Set FontSize 28
Type "printf 'hello\n'"EnterWait+Screen "hello"Tokenization
Section titled “Tokenization”Tapes use shell-like tokenization for each non-comment line. Quote strings that contain spaces, newlines, regex characters, ANSI escapes, or shell syntax.
- Blank lines are ignored.
- Lines whose trimmed form starts with
#are comments. - Multiple commands may appear on one line.
- One command per line is usually easier to review by hand.
Type "printf 'hello from betamax\n'"Wait+Screen "hello from betamax"Wait+Screen "/item-[0-9]+/"
Type "printf 'done\n'"EnterWait+Screen "done"Synchronization
Section titled “Synchronization”Prefer waits over long sleeps. A sleep records whatever happens for a fixed amount of time; a wait records until expected terminal text exists or the timeout expires.
Type "cargo test --quiet"EnterWait+Screen "test result:"Validation and review media
Section titled “Validation and review media”For tests, run the actions you want to check and save State or Screenshot checkpoints after
waiting for the expected output. For demos, add pauses so viewers can read the result.
Use Wait, Wait+Line, or Wait+Screen to check text before the tape continues. Use Sleep for
reading time, or when the application provides no text or prompt to wait for.
Type "my-app --demo"EnterWait+Screen "Ready"Screenshot target/review/ready.pngSleep 500msPresentation and layout proof
Section titled “Presentation and layout proof”Larger FontSize, Margin, window bars, and border radius are presentation choices. They make a
demo easier to read, but they also change the terminal grid and available layout space.
When testing modal placement, centering, wrapping, or split panes, start with the default
FontSize and Margin. Increase Width and Height if the application needs more space.
Use a separate tape for a demo that needs larger text.
Set Width 1600Set Height 900Wait+Screen "Preview"Screenshot target/layout/proof.pngHidden work
Section titled “Hidden work”Hide and Show
are visibility controls, not execution controls. Hidden commands still run in the PTY, update
terminal state, and can be waited on.
HideType "cargo build --quiet"EnterWaitShowOutputs during a tape
Section titled “Outputs during a tape”Output describes final artifacts written after
execution. Screenshot and
State write checkpoint artifacts immediately at
their position in the tape.
Wait+Screen "Saved profile"Screenshot target/snapshots/profile.pngState target/snapshots/profile.state.jsonShell defaults
Section titled “Shell defaults”For common shells such as bash, zsh, and fish, Betamax starts a clean recording-oriented
environment where possible. The default prompt behavior aims for VHS-like output: a simple >
prompt rather than host-specific prompts such as bash-5.3$.
Set Shell "bash"Set Shell "zsh -f"Set Shell "fish --private"