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”Most tapes have one primary job. Validation tapes exercise a user journey, wait for semantic
screen state, and write focused State or Screenshot checkpoints for assertions. Example and
review-media tapes make a stable state readable for humans in a GIF, video, or PR artifact.
Waits are assertions and synchronization points. Use Wait, Wait+Line, or Wait+Screen to name
the state that must exist before the tape continues. Sleeps are presentation pacing after that
state is true, unless the application has no semantic text or prompt that Betamax can 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 a tape proves modal placement, centering, wrapping, or split-pane behavior, start with the
default FontSize and Margin. Increase Width and Height when the proof needs a wider canvas.
Use a separate review-media tape when the same journey also needs zoomed presentation.
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"