znippy-cli — crate card
Reverse-engineered (from source — verify, don't trust the name)
- One-line pitch: The
znippycommand-line tool — clap-based front end wiring compress/decompress/list/verify/handlers/run over the workspace crates. - Does:
lib.rsdefines the clapCli/Commands(compress with--format/--meta-format/--warehouse/--plugin, decompress, list, verify, handlers, run) and therun()entry point thatmain.rscalls.handlers.rsis the single plugin-registration point (builtin_handlers()) — the CLI autodiscovers handlers via each plugin'smeta(), withfind_handlerresolving--formatby name/alias. Optionalicebergandsignfeatures gate the Iceberg meta backend and CMS provenance. - Version stamp:
znippy --version/-Vprintsznippy v<CARGO_PKG_VERSION> (<git hash>)and exits (clap's version flag; command nameznippy+VERSION_LINE). The short SHA comes frombuild.rs, which reads it straight from the on-disk git metadata with purestd::fs— NOCommand::new("git"), per the zero-shell law.build.rswalks up from the crate manifest to the workspace.git, handles a symbolic or detached HEAD,packed-refs, and linked worktrees (.gitpointer file +commondir), and emitscargo:rustc-env=ZNIPPY_GIT_HASH=<7-char sha>(falling back tounknownoff a checkout).lib.rsexposes it aspub const GIT_HASH/VERSION_LINE(built withenv!, the ONE identity source) so theznippybin in the parent crate inherits the same string viarun(). - Introspection: every verb self-reports a
functional_statusrow (compress→archive_written, verify→integrity_checksum, decompress→reconstruct_verify, sign→compress-sign/signer_loaded, verify-signed→provenance_chain, plus append/run) — GREEN on success, RED on failure — behind the optionaltestmatrixfeature (an#[inline]no-op with no nornir dep in the default build). Red-when-broken tests:green_roundtrip_then_red_on_corruptionandbuild_signer_missing_cert_emits_red_row. See.nornir/quality-matrix.mdfor the full surface table. - Key deps:
clap(derive),znippy-compress,znippy-decompress,znippy-common(host-decompressors + wasm-plugins), the three plugin crates (maven/python/media) plus the native handlers from common, optionalznippy-iceberg,env_logger. - Shape: both (lib +
znippybin viamain.rs), ~600 LOC:lib.rs(516),handlers.rs(84),main.rs(3). - Observed role in the workspace: Top of the stack — the top-level
znippycrate is just a bin wrapper that callsznippy_cli::run(). This is where all handlers get registered and all verbs dispatch.
Fill in (one line each — only the human knows these)
- Primary consumer(s):
- Why it exists (vs the obvious alternative):
- Hard constraint (airgap / no-C-deps / no-FFI / pure-Rust / etc.):
- Release cadence & independence (rides a parent? own repo someday?):
- Status (production / prototype / experimental / stubbed):
- Must-NOT-change invariant:
- Biggest known gap or TODO:
- Anything a newcomer would get wrong about it: