Context
The CLI is about to gain several new commands (chains, doctor, --json flag, error message improvements). Before that surface expands, we need a test foundation that locks the current output and catches regressions when changes are made. Snapshot tests are the cheapest way to do this for CLI output.
What to build
Add Vitest-based snapshot tests that exercise every existing CLI command:
- Capture stdout and stderr
- Capture exit code
- Normalize anything non-deterministic (timestamps, paths, version numbers) before snapshot comparison
Set up the test infrastructure so future commands can be added with minimal boilerplate (a helper like runCli(args) returning { stdout, stderr, exitCode }).
Acceptance criteria
Pointers
- Vitest snapshot docs
- Look at how
gh CLI or npm CLI test their output for inspiration
Complexity
🔴 Advanced
Context
The CLI is about to gain several new commands (
chains,doctor,--jsonflag, error message improvements). Before that surface expands, we need a test foundation that locks the current output and catches regressions when changes are made. Snapshot tests are the cheapest way to do this for CLI output.What to build
Add Vitest-based snapshot tests that exercise every existing CLI command:
Set up the test infrastructure so future commands can be added with minimal boilerplate (a helper like
runCli(args)returning{ stdout, stderr, exitCode }).Acceptance criteria
runClihelper exists for adding new testsPointers
ghCLI ornpmCLI test their output for inspirationComplexity
🔴 Advanced