transcript

command module
v0.0.0-...-2e371fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

README

Transcript

transcript is a CLI tool for snapshot testing command-line programs.

Tests are written in a small, line-oriented format (usually *.cmdt) that captures a shell session: commands, stdout/stderr, and exit codes. The format is designed to be readable in reviews and easy to update when outputs change.

Highlights

  • Record sessions interactively (transcript shell)
  • Check transcripts in CI (transcript check)
  • Update expectations when outputs change (transcript update)
  • Reference external files for large or binary output (1< / 2<)
  • Embed transcripts in Go tests via cmdtest.Check

Quick Start

Create a transcript and check it:

cat > demo.cmdt <<EOF
$ echo stdout
1 stdout

$ echo stderr 1>&2
2 stderr

# Non-zero exit codes.
$ false
? 1
EOF

transcript check ./demo.cmdt

Install

go install github.com/deref/transcript@latest

Transcript is not Go-specific, but it is written in Go and can be used in Go test suites via cmdtest.Check.

Documentation

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cli
tests
interleave command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL