smoketape
Tiny, deterministic smoke tests for CLIs. Write a readable YAML tape, replay it in a local temp sandbox, and get proof that a command ran, output matched, files appeared, and secrets were redacted. 🎞️
smoketape is built for agent-made developer tools where a unit test is not quite enough and a hand-written shell script is too opaque.
Install
The npm package has not been published yet. After the first successful registry release, install it with:
npm install -D smoketape
npx smoketape initUntil then, install from a checkout for local development:
npm install
npm run build
node dist/src/index.js run fixtures/sample.yml --report reports/sample.mdCLI
smoketape init
smoketape run smoketape.yml --report reports/smoke.md
smoketape run fixtures/sample.yml --json
smoketape run fixtures/sample.yml --timeout-ms 10000
smoketape explain reports/smoke.jsonsmoketape run --timeout-ms <ms sets the default per-step timeout. The value must be a positive integer no greater than 2147483647, the Node.js timer maximum.
Programmatic API
Importing smoketape is side-effect free. The package root exports the tape runner, report formatters, report explainer, and their TypeScript types:
import { runTape, renderJson } from 'smoketape';
const report = await runTape('smoketape.yml');
console.log(renderJson(report));The command-line executable is available separately through the smoketape binary.
Tape schema
version: 1
name: my-cli-smoke
timeoutMs: 5000
fixtures: fixtures/demo
redactions:
- ${SECRET_VALUE}
steps:
- name: run the command
command: node demo/cli.mjs --name Roger
env:
CI: true
expect:stdout: contains: "hello Roger" regex: "hello\\s+Roger" notContains: "SECRET" stderr: notContains: "UnhandledPromiseRejection" files: