Skip to content

Examples

The repository examples are intentionally small. They are smoke tests for core behavior and copyable starting points for your own tapes. Render all examples from a checkout with:

Terminal window
scripts/render-examples.sh

Generated files are written under examples/output and copied to target/betamax-examples for local inspection. README and site GIF previews are hosted as GitHub Release assets so generated media does not need to live in the source tree.

TapeDemonstratesUseful docs
basic.tapetyping, waits, theme, window bar, border radiusTape files, themes
hide-show.tapehidden setup and hidden trailing cleanupHidden work
waits.tapeline, screen, regex, and default prompt waitsWait commands
keys.tapekey commands, repeats, editing, and interruptKey commands
clipboard-env.tapeEnv, Copy, and PasteTape reference
outputs.tapeGIF, PNG, JSON, screenshot, state, frame dirOutputs
scrollback.tapescrollback-inclusive state JSONState JSON
text-styles.tapeANSI styles, truecolor, and styled state spansState JSON
layout.tapepadding, margin, fill, window bar, radiusThemes and styling
themes.tapecopied Ghostty themes and palette mappingTheme lookup
screenshot.tapescreenshots and terminal state JSONCheckpoints
video.tapeGIF, MP4, and WebM from one captureVideo encoding

These previews come from the example tapes above.

Basic Betamax GIF

basic.tape is the smallest useful demo: it sets a portable shell, chooses Aardvark Blue, types one command, waits for the result, and hides shell cleanup.

Hide and Show Betamax GIF

hide-show.tape demonstrates the most important authoring trick. Hidden setup still runs and updates terminal state, but the animation starts only when Show reveals the prepared screen.

Ghostty theme Betamax GIF

themes.tape shows ANSI colors mapped through a bundled Ghostty theme. Use betamax themes to list the names available to Set Theme.

Video output Betamax GIF

video.tape writes GIF, MP4, and WebM from one capture. The GIF is encoded in process; MP4 and WebM are handed to ffmpeg.

Use examples/outputs.tape when checking artifact behavior. It writes a GIF, a PNG, final state JSON, a PNG frame directory, a checkpoint screenshot, and checkpoint state JSON.

Use examples/scrollback.tape and examples/text-styles.tape when evaluating terminal testing. Together they exercise the parts of state JSON that matter for snapshot tests: viewport text, scrollback text, default style, non-default style table entries, and styled spans.

Use examples/waits.tape when debugging timing. It shows the three wait targets and a custom WaitPattern, which is usually preferable to adding sleeps.