@etapsky/sdf-cli
@etapsky/sdf-cli is the official command-line tool for working with Smart Document Format files. Use it to inspect documents, validate structure, sign and verify authenticity, convert data to .sdf, and interact with the schema registry.
Version: 0.3.2 · License: MIT
Installation
npm (global)
npm install -g @etapsky/sdf-cliHomebrew (macOS / Linux)
brew tap etapsky/tapbrew install sdf-cliDirect binary download
Pre-compiled binaries are available on GitHub Releases for four platforms:
| Platform | Architecture | Binary |
|---|---|---|
| macOS | Apple Silicon (arm64) | sdf-macos-arm64 |
| macOS | Intel (x64) | sdf-macos-x64 |
| Linux | x64 | sdf-linux-x64 |
| Linux | arm64 | sdf-linux-arm64 |
curl -L https://github.com/etapsky/sdf/releases/latest/download/sdf-macos-arm64 -o /usr/local/bin/sdfchmod +x /usr/local/bin/sdfBun (project-local)
bun add -d @etapsky/sdf-clibunx sdf --helpVerify installation
sdf --version# @etapsky/sdf-cli 0.3.2Commands
| Command | Description |
|---|---|
sdf inspect | Print a full inspection report — meta, schema summary, data tree, and layer sizes |
sdf validate | Validate an SDF file. Exits 0 on success, 1 on failure. CI-friendly. |
sdf sign | Digitally sign an SDF file using ECDSA P-256 or RSA-2048 |
sdf verify | Verify the digital signature of a signed SDF file |
sdf keygen | Generate an ECDSA P-256 or RSA-2048 key pair |
sdf wrap | Wrap an existing PDF into an SDF container |
sdf convert | Convert data.json + schema.json into a .sdf file with auto-generated PDF |
sdf schema | Schema registry operations — list, diff, validate |
Global flags
These flags are accepted by all commands:
| Flag | Description |
|---|---|
--json | Output results as JSON instead of formatted text. Useful for scripting and piping to jq. |
--no-color | Disable ANSI color output. Automatically set when stdout is not a TTY. |
--help, -h | Print help for the current command and exit. |
--version, -v | Print the CLI version and exit. |
Quick start
# Inspect an SDF filesdf inspect invoice.sdf
# Validate for CIsdf validate invoice.sdf && echo "Valid"
# Generate a key pairsdf keygen --algorithm ECDSA-P256 --out keys/
# Sign a documentsdf sign invoice.sdf --key keys/private.pem --out invoice-signed.sdf
# Verify the signaturesdf verify invoice-signed.sdf --key keys/public.pem
# Convert JSON data to SDFsdf convert data.json schema.json \ --output invoice.sdf \ --issuer "Acme GmbH" \ --type invoice
# Wrap an existing PDFsdf wrap invoice.pdf \ --data data.json \ --schema schema.json \ --output invoice.sdf