cast
The cast step type records deterministic terminal demos as asciicast files. It can run nested workflow steps, simulate typed commands, and render additional outputs from the same recording.
steps:
- name: list-stacks
type: cast
mode: steps
command: atmos list stacks --format=tree
defaults:
cast:
rate: 12ms
width: 120
height: 36
simulate:
mode: typed
cursor: true
rate: 35ms
prompt:
text: "> "
style: command
output:
cast: website/static/casts/list-stacks.cast
steps:
- type: simulate
text: atmos list stacks --format=tree
- type: shell
output: raw
command: atmos list stacks --format=tree
- type: toast
level: success
content: Cast recorded.
Fields
mode- Recording mode. Use
stepsfor deterministic nested workflow steps, orsessionfor interactive terminal sessions. command- Optional command string stored in the asciicast header.
output.cast- Path for the generated
.castfile. output.gif,output.mp4- Optional animated outputs rendered after the cast recording succeeds. Atmos automatically installs the managed
aggrenderer for GIF andaggplus FFmpeg for MP4 on first use. MP4 is produced from a GIF and can retain GIF palette constraints. output.html,output.ascii,output.png,output.jpg- Optional static outputs rendered natively from the recording's final terminal content — an inline-styled HTML fragment, plain text with no ANSI codes, or a terminal screenshot image. No external tools required.
.asciiartifacts are cheap to commit and diff, and can be consumed by other tooling without an asciicast player. defaults.cast- Recording defaults for the cast step. Supports
rate,width, andheight. Explicit top-levelrate,width, orheightfields on the cast step override these defaults. defaults.simulate- Defaults applied to direct child
type: simulatesteps. Supportsmode,cursor,prompt,rate,jitter,duration, andinterval. Explicit fields on the child simulate step override these defaults, includingcursor: false. env- Environment variables available to nested cast steps.
working_directory- Directory inherited by nested steps that do not define their own working directory.
steps- Nested workflow steps to execute while the recorder is active. In
stepsmode,shell,simulate,toast, and other normal workflow steps can be recorded.
Use shared YAML includes for repeated recording settings when multiple casts should have the same terminal dimensions, playback rate, simulated prompt, or recording environment.
Tape interpretation
A cast step can interpret VHS-dialect tape script text directly, in memory, instead of a hand-authored steps: list — useful when you already have a .tape file (for example, one written for the real vhs binary) and want to point Atmos at it directly.
tape- Inline, multi-line VHS-dialect script. Mutually exclusive with
tape_fileand with an explicitsteps:list. tape_file- Path to an external
.tapefile, interpreted the same way astape.Sourcedirectives anywhere in it (including nestedSources) resolve relative to the step'sworking_directory(or the process CWD if unset) — the same basetape_fileitself resolves against, matching realvhs, which resolves everySourcein a script relative to its own invocation directory, not relative to whichever file aSourcehappens to be read from.
steps:
- name: hero-demo
type: cast
mode: session
tape_file: demo/hero.tape
output:
mp4: hero.mp4
steps:
- name: quick-check
type: cast
mode: steps
tape: |
Type "atmos list stacks" Enter
Type "atmos validate stacks" Enter
output:
cast: quick-check.cast
mode: steps vs mode: session
The existing mode field governs how a tape is translated, and it determines whether a failing typed command actually fails the step:
mode: steps(exit-code fidelity) — eachType "cmd" Enterbecomes atype: simulatechild (so it looks typed in the recording) paired with a realtype: shellchild that actually executescmd, with a real, tracked exit code.Sleep/Waitare dropped (step execution is already synchronous). A visiblecd/export/unset/clearcommand updates the following real steps'working_directory/envinstead of running as its own (state-losing) subprocess.Screenshotis supported. Any directive with no discrete-step equivalent — a bare keypress,Hide/Show, or aTypewith no trailingEnter— is a parse-time error naming the offending line, telling you to switch tomode: session.mode: session(raw keypress/PTY fidelity) —Type/Sleep/Wait/keypresses (includingCtrl+<letter>) map onto the existingwrite/key/pause/waitsession actions. This keepsmode: session's existing limitation: no per-command exit code, since the whole script drives one continuous PTY session.
Set, Output, Require, Source
| VHS directive | Atmos target | Notes |
|---|---|---|
Set Shell, Set Width, Set Height, Set TypingSpeed, Set WaitTimeout | shell, width/height, write_rate, default Wait timeout | An explicit field on the step always wins over a tape-implied value. |
Set FontFamily/FontSize/Theme/Margin/Padding/BorderRadius/Framerate/CursorBlink/WaitPattern/... | (ignored) | Cosmetic VHS options with no Atmos rendering analog. |
Output <path> | output.* | One per supported extension (.cast, .gif, .mp4, .html, .ascii, .png, .jpg/.jpeg) — .webm and .txt are not supported and produce an error. |
Require <program> | a synthesized type: require child | Runs the same tool-presence check as a hand-authored type: require step, before the cast body executes. |
Source <file> | inlined directives | Resolved relative to the step's working_directory (or the process CWD) — the same fixed base used for tape_file itself and for every Source, no matter how deeply nested. |
Hide / Show | lifted into env:/working_directory:, or literal replay | A Hide...Show region whose commands are only export/unset/cd/clear is lifted into the step's own config (no PTY replay needed); anything else falls back to literal typing while muted. mode: steps has no PTY at all, so Hide/Show are always an error there. |
Copy, Paste, Env | (unsupported) | Always a parse error in both modes — rewrite the tape (inline Env as a shell export, replace Copy/Paste with a direct Type) before using tape:/tape_file:. |
atmos cast record
For a one-off tape with no workflow YAML at all, use the record subcommand directly:
atmos cast record demo/hero.tape --output=hero.mp4
record builds an ephemeral type: cast step from the tape and runs it through the same interpreter — see atmos cast record for the full flag reference. For the complete supported/ignored/error directive matrix and worked migration examples, see the atmos-vhs skill.