Dashboard

CLI Reference

The @fhirfly-io/shl package includes a CLI for common SHL workflows.

npx @fhirfly-io/shl --help

Commands

validate

Validate a FHIR Bundle JSON file against IPS requirements.

fhirfly-shl validate <bundle.json> [options]
OptionDescription
--strictTreat warnings as errors (exit code 1)
--profile <ips|r4>Validation profile (default: ips)
--jsonOutput result as JSON

Exit codes: 0 = valid, 1 = errors, 2 = warnings only

create

Create a SMART Health Link from a FHIR Bundle JSON file.

fhirfly-shl create <bundle.json> [options]
OptionDescription
--passcode <code>Passcode to protect the SHL
--exp <duration>Expiration (e.g., 24h, 7d, 30d)
--label <text>Label shown in viewer apps
--dir <path>Storage directory (default: ./shl-data)
--base-url <url>Base URL for serving (default: http://localhost:3456/shl)
--output <dir>Directory to save QR code PNG
--jsonOutput result as JSON

decode

Decode a shlink:/ URL and display its components.

fhirfly-shl decode <shlink-url> [options]
OptionDescription
--jsonOutput result as JSON

serve

Start a local HTTP server for serving SHLs.

fhirfly-shl serve [options]
OptionDescription
--port <number>Port to listen on (default: 3456)
--dir <path>Storage directory (default: ./shl-data)

demo

Run a full round-trip demo: build IPS bundle, create SHL, optionally start server.

fhirfly-shl demo [options]
OptionDescription
--port <number>Server port (default: 3456)
--no-serveSkip starting the local server