← 全部工具

rogerchappel/clisnapshot

热度 75 更新于 网络与系统管理

Stable snapshots for terminal output without the confetti drift

githubauto-collected

安装

暂未验证可直接使用的安装命令,请查看项目官方文档或 Release。

clisnapshot

Stable snapshots for terminal output without the confetti drift 📸

clisnapshot is a local-first CLI snapshot runner for people who build command-line tools. It runs named fixture commands, scrubs noisy output, and compares stdout, stderr, and exit codes against plain text snapshots you can review in git.

Why it exists

CLI output drifts for boring reasons: ANSI color, UUIDs, dates, temp paths, home directories, durations, and platform-specific paths. clisnapshot keeps the useful signal while sanding down the confetti.

Cases that exceed their timeout are rejected with CASETIMEOUT only after their spawned process tree has been terminated. On POSIX systems, clisnapshot gives the dedicated process group a short SIGTERM grace period before escalating to SIGKILL; on Windows it uses taskkill /T and then /F to clean up descendants.

Install

The package has not been published to npm yet. Until npm view clisnapshot version succeeds, build a tarball from a clean checkout:

git clone https://github.com/rogerchappel/clisnapshot.git
cd clisnapshot
npm ci
npm run build
mkdir -p /tmp/clisnapshot-package
npm pack --pack-destination /tmp/clisnapshot-package

Then install that tarball in the project where you want to use it (replace the example with the absolute path printed by npm pack):

npm install --save-dev /absolute/path/to/clisnapshot-0.1.0.tgz

Once npm view clisnapshot version succeeds, install from the registry instead:

npm install --save-dev clisnapshot

Quick start

After installing the local tarball, run the checked-in executable without allowing npx to download a different package:

npx --no-install clisnapshot init
npx --no-install clisnapshot run --update
npx --no-install clisnapshot run

Once the package is published, the normal registry-backed commands are:

npx clisnapshot init
npx clisnapshot run --update
npx clisnapshot run