shout in go
Go to file
2026-03-10 17:02:27 -07:00
test Add shout shell output tester initial implementation 2026-03-10 12:01:47 -07:00
.gitignore install script 2026-03-10 16:30:28 -07:00
cmd.go skip --update when output has "$ " lines; fix wait 2026-03-10 14:47:57 -07:00
color.go Add shout shell output tester initial implementation 2026-03-10 12:01:47 -07:00
format.go Refactor exit code logic and remove Verbose flag 2026-03-10 12:45:49 -07:00
go.mod Add shout shell output tester initial implementation 2026-03-10 12:01:47 -07:00
go.sum Add shout shell output tester initial implementation 2026-03-10 12:01:47 -07:00
install.sh install script 2026-03-10 16:30:28 -07:00
main.go Add shout shell output tester initial implementation 2026-03-10 12:01:47 -07:00
Makefile install script 2026-03-10 16:30:28 -07:00
match_test.go Add memoization to match and fix zero-timeout 2026-03-10 15:06:23 -07:00
match.go Add memoization to match and fix zero-timeout 2026-03-10 15:06:23 -07:00
parse_test.go Add shout shell output tester initial implementation 2026-03-10 12:01:47 -07:00
parse.go fix sentinel collision, backslash escape, and timeout cleanup 2026-03-10 12:20:11 -07:00
README.md url 2026-03-10 17:02:27 -07:00
run.go Add memoization to match and fix zero-timeout 2026-03-10 15:06:23 -07:00
types.go Refactor exit code logic and remove Verbose flag 2026-03-10 12:45:49 -07:00
update.go skip --update when output has "$ " lines; fix wait 2026-03-10 14:47:57 -07:00

shout

shout is kinda like really basic integration testing for your cli.

Write .shout files that look like shell sessions and run shout to test 'em.

Install

curl -fsSL https://because.sh/shout | sh

Features

Everything you could ever ask for:

$ echo hello
hello

$ brew --version
Homebrew 5...

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

... matches anything — a whole line inline, or any number of lines on its own.

[1] after the expected output matches the exit code.

Usage

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

shout test runs code in a temp directory. -k/--keep keeps it around.

--update will modify .shout files to match reality, without running any tests.

Each line in a .shout file is run sequentially, unless --parallel is passed.

Usage: shout test [options] [files...]

Run .shout test files

Arguments:
  files            Files or directories to test

Options:
  -u, --update     Rewrite expected output in-place with actual output
  -k, --keep       Keep temp directories after run
  --clean-env      Start with empty environment
  --path <path>    Prepend <path> to PATH (repeatable)
  --timeout <dur>  Per-command timeout (default: "10s")
  -v, --verbose    Print each command as it runs
  --parallel       Run files in parallel
  -h, --help       display help for command

Print an example .shout file:

$ shout example