← All tools

rogerchappel/clifingerprint

Popularity 75 Updated Development & Build

Record observable CLI contracts and detect changes between builds

githubauto-collected

Installation

A directly usable install command is not verified yet. Check the project documentation or releases.

clifingerprint

Local-first CLI contract recording and comparison.

clifingerprint runs configured command probes, records the observable CLI contract, and compares fresh runs against a saved baseline. It is meant for maintainers who want release checks for help text, options, examples, exit codes, stdout/stderr snippets, and package metadata.

Install

Development and release verification cover Node.js 20.19, 22, and 24 with npm 10. The repository pins npm 10.9.4 so clean installs use the lockfile's verified package-manager version. scripts/validate.sh follows this declared npm toolchain even when other package managers are installed:

npx --yes npm@10.9.4 ci

Run from the repository:

node src/cli.js --help

The package exposes the cli-fp binary when installed.

Quick Start: Record A Fingerprint

node src/cli.js record clifingerprint.yaml --output fingerprint.json

record executes every non-skipped probe in the config and writes a JSON fingerprint, creating missing parent directories in the --output path. Intentionally skipped probes remain in the fingerprint, and their expected exit code is not evaluated. It exits with code 1 without saving when a command cannot be executed, a probe times out, or a completed probe does not match its expectedExitCode.

Compare Against A Baseline

node src/cli.js compare fingerprint.json clifingerprint.yaml

compare runs the probes again and exits with code 1 when the current contract differs from the baseline. A fresh execution error, timeout, or expectedExitCode mismatch also fails comparison even when the saved baseline contains the same failure state, preventing broken probes from being reported as compatible.

Show A Summary

node src/cli.js show fingerprint.json

Each probe is marked ✓ when it completed successfully, including an expected nonzero exit, ○ when it was intentionally skipped, or ✗ for an expected-exit mismatch, timeout, execution error, or unexpected nonzero exit. The summary names timeout and execution-error states and shows both actual and expected codes for an exit mismatch.