@verifyfetch/cli
v1.0.0
Published
Generate SRI hashes and chunked verification for resumable downloads. Works with WASM, AI models, and any binary files.
Downloads
916
Maintainers
Readme
Quick Start
# Generate hashes for your files
npx @verifyfetch/cli sign ./public/*.wasm ./models/*.bin
# Output: vf.manifest.jsonCommands
sign — Generate SRI Hashes
npx @verifyfetch/cli sign <files...> [options]| Option | Description |
|--------|-------------|
| -o, --out <file> | Output manifest path (default: vf.manifest.json) |
| -a, --algorithm <alg> | Hash algorithm: sha256, sha384, sha512 (default: sha256) |
| -b, --base <path> | Base path for URLs (default: /) |
| -u, --update | Update existing manifest instead of replacing |
| -c, --chunked | Generate per-chunk hashes (for resumable downloads) |
| --chunk-size <bytes> | Chunk size in bytes (default: 1MB) |
Examples:
# Single file
npx @verifyfetch/cli sign ./public/app.wasm
# Multiple files with custom output
npx @verifyfetch/cli sign ./dist/*.js -o ./public/manifest.json
# Use SHA-384
npx @verifyfetch/cli sign ./models/* -a sha384
# For large files: enable resumable downloads
npx @verifyfetch/cli sign --chunked ./large-model.binenforce — Verify in CI/CD
npx @verifyfetch/cli enforce [options]| Option | Description |
|--------|-------------|
| -m, --manifest <file> | Manifest path (default: vf.manifest.json) |
| -s, --strict | Fail if extra files exist in directories |
| -p, --base-path <path> | Base path to resolve files from |
Example CI usage:
# GitHub Actions
- name: Verify integrity
run: npx @verifyfetch/cli enforceExits with code 1 if any file hash doesn't match — perfect for CI pipelines.
init — Project Setup
npx @verifyfetch/cli init [options]| Option | Description |
|--------|-------------|
| --next | Initialize for Next.js |
| --vite | Initialize for Vite |
Manifest Format
v1 (simple):
{
"version": 1,
"base": "/",
"artifacts": {
"/app.wasm": {
"sri": "sha256-uU0nuZNNPgilLlLX2n2r+sSE7+N6U4DukIj3rOLvzek="
}
}
}v2 (with --chunked for resumable downloads):
{
"version": 2,
"base": "/",
"artifacts": {
"/large-model.bin": {
"sri": "sha256-fullFileHash...",
"size": 4294967296,
"chunked": {
"root": "sha256-rootHash...",
"chunkSize": 1048576,
"hashes": ["sha256-chunk0...", "sha256-chunk1...", "..."]
}
}
}
}Related
- verifyfetch — Core library
- GitHub
License
Apache-2.0
