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]
Option Description
--strict Treat warnings as errors (exit code 1)
--profile <ips|r4> Validation profile (default: ips)
--json Output 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]
Option Description
--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
--json Output result as JSON

decode

Decode a shlink:/ URL and display its components.

fhirfly-shl decode <shlink-url> [options]
Option Description
--json Output result as JSON

serve

Start a local HTTP server for serving SHLs.

fhirfly-shl serve [options]
Option Description
--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]
Option Description
--port <number> Server port (default: 3456)
--no-serve Skip starting the local server