.agent/skills/vhs.md
VHS records terminal sessions into GIFs/MP4s/WebMs from .tape scripts. Run with vhs demo.tape.
Type, Sleep, Enter are separate directives on the same line, delimited by the closing " of the Type string. The most common bug is forgetting to close the Type string, which causes Sleep/Enter to be typed literally into the terminal.
# ✅ CORRECT — closing " before Sleep
Type "echo hello" Sleep 300ms Enter
# ❌ WRONG — Sleep and Enter are typed as literal text
Type "echo hello Sleep 300ms Enter
Override typing speed per-command with @<time> immediately after Type (no space):
Type@80ms '{"pageSize": 2}' Sleep 100ms
"..." are the standard Type delimiter'...' also work and are useful when the typed content contains double quotes (e.g. JSON)Type `VAR="value"`Type lines:Type "gws drive files list --params '" Sleep 100ms
Type@80ms '{"pageSize": 2, "fields": "nextPageToken,files(id)"}' Sleep 100ms
Type "' --page-all" Sleep 300ms Enter
Pitfall: Every
Typeline that is followed bySleeporEnteron the same line MUST close its string first. Audit each line to ensure the quote is closed before any directive.
Settings must appear before any non-setting command (except Output). TypingSpeed is the only setting that can be changed mid-tape.
Output demo.gif
Set Shell "bash"
Set FontSize 14
Set Width 1200
Set Height 1200
Set Theme "Catppuccin Mocha"
Set WindowBar Colorful
Set WindowBarSize 40
Set TypingSpeed 40ms
Set Padding 20
| Command | Example | Notes |
|---|---|---|
Output | Output demo.gif | .gif, .mp4, .webm |
Type | Type "ls -la" | Type characters |
Type@<time> | Type@80ms "slow" | Override typing speed |
Sleep | Sleep 2s, Sleep 300ms | Pause recording |
Enter | Enter | Press enter |
Hide / Show | Hide ... Show | Hide setup commands |
Ctrl+<key> | Ctrl+C | Key combos |
Tab, Space, Backspace | Tab 2 | Optional repeat count |
Up, Down, Left, Right | Up 3 | Arrow keys |
Wait | Wait /pattern/ | Wait for regex on screen |
Screenshot | Screenshot out.png | Capture frame |
Env | Env FOO "bar" | Set env var |
Source | Source other.tape | Include another tape |
Require | Require jq | Assert program exists |
Use Hide/Show to run setup commands (e.g. setting $PATH, clearing screen) without recording them:
Hide
Type "export PATH=$PWD/target/release:$PATH" Enter
Type "clear" Enter
Sleep 2s
Show
Type string must be closed before Sleep/Enter on the same lineEnterTypingSpeed can appear latervhs <file>.tape before committing