$ shout

Write shell sessions. Run them as tests.

$ bun install -g @because/shout click to copy

Write a test

A .shout file is just a shell session. Commands start with $, everything else is expected output.

$ echo hello
hello

$ ls missing
ls: missing: No such file or directory
[1]

$ brew --version
Homebrew ...

... matches anything — inline or across lines. [1] asserts the exit code.

Run it

$ shout
...............
15 passed in 23ms

Each file gets a fresh temp directory and its own /bin/sh session. State carries between commands within a file.

Update expectations

$ shout --update

Rewrites your .shout files with the actual output. No more copy-pasting from the terminal.

Features

Wildcards

... matches anything — inline for partial lines, standalone for multiple lines.

Exit codes

[N] asserts a specific exit code. [*] matches any non-zero code.

Parallel

--parallel runs test files concurrently. Each gets its own shell.

Timeouts

--timeout 5s per-command timeout. Supports ms, s, m.

PATH control

--path ./bin prepends to PATH. Test your local builds.

Verbose

-v prints each command as it runs. See what's happening.