Skip to content

@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)

Terminal
npm install -g @etapsky/sdf-cli

Homebrew (macOS / Linux)

Terminal
brew tap etapsky/tap
brew install sdf-cli

Direct binary download

Pre-compiled binaries are available on GitHub Releases for four platforms:

PlatformArchitectureBinary
macOSApple Silicon (arm64)sdf-macos-arm64
macOSIntel (x64)sdf-macos-x64
Linuxx64sdf-linux-x64
Linuxarm64sdf-linux-arm64
Terminal — macOS arm64 example
curl -L https://github.com/etapsky/sdf/releases/latest/download/sdf-macos-arm64 -o /usr/local/bin/sdf
chmod +x /usr/local/bin/sdf

Bun (project-local)

Terminal
bun add -d @etapsky/sdf-cli
bunx sdf --help

Verify installation

Terminal
sdf --version
# @etapsky/sdf-cli 0.3.2

Commands

CommandDescription
sdf inspectPrint a full inspection report — meta, schema summary, data tree, and layer sizes
sdf validateValidate an SDF file. Exits 0 on success, 1 on failure. CI-friendly.
sdf signDigitally sign an SDF file using ECDSA P-256 or RSA-2048
sdf verifyVerify the digital signature of a signed SDF file
sdf keygenGenerate an ECDSA P-256 or RSA-2048 key pair
sdf wrapWrap an existing PDF into an SDF container
sdf convertConvert data.json + schema.json into a .sdf file with auto-generated PDF
sdf schemaSchema registry operations — list, diff, validate

Global flags

These flags are accepted by all commands:

FlagDescription
--jsonOutput results as JSON instead of formatted text. Useful for scripting and piping to jq.
--no-colorDisable ANSI color output. Automatically set when stdout is not a TTY.
--help, -hPrint help for the current command and exit.
--version, -vPrint the CLI version and exit.

Quick start

Terminal
# Inspect an SDF file
sdf inspect invoice.sdf
# Validate for CI
sdf validate invoice.sdf && echo "Valid"
# Generate a key pair
sdf keygen --algorithm ECDSA-P256 --out keys/
# Sign a document
sdf sign invoice.sdf --key keys/private.pem --out invoice-signed.sdf
# Verify the signature
sdf verify invoice-signed.sdf --key keys/public.pem
# Convert JSON data to SDF
sdf convert data.json schema.json \
--output invoice.sdf \
--issuer "Acme GmbH" \
--type invoice
# Wrap an existing PDF
sdf wrap invoice.pdf \
--data data.json \
--schema schema.json \
--output invoice.sdf