SDD Command Line Tools
The command-line (CLI) tool sdd is the entrypoint for working with .sdd files in this repository. It validates documents against profiles, compiles documents into canonical JSON, and generates diagrams.
(This is different from sdd-helper. sdd is the normal tool for people running straightforward CLI workflows. sdd-helper is the JSON-first tool for automation and structured mutation flows.)
If You Are New To The Command Line
You do not need to learn the whole terminal to use the sdd CLI tool. You can copy and paste the example commands exactly.
- When you see
<input>, it means “the path to your.sddfile”. - When you use
--out, you are choosing where the generated file should be written. - If you omit
--outwithsdd show, the preview file is written beside the input file as<source>.<view>.<profile>[.<backend>].<format>.
If you want a visual result quickly, start with the next section and use the commands as written.
Fastest Path To A Result
For most people, sdd show is the right first command. It compiles the document, validates it, and generates a preview artifact for a chosen view.
Start with the simple profile. The CLI default is strict, but simple is the better starting point for early work because it is lower-noise and better suited to drafting.
SVG quick-start:
pnpm sdd show bundle/v0.1/examples/outcome_to_ia_trace.sdd --view ia_place_map --profile simple --out ./outcome.svgPNG quick-start:
pnpm sdd show bundle/v0.1/examples/outcome_to_ia_trace.sdd --view ia_place_map --profile simple --format png --out ./outcome.png(Inside this repository, use pnpm sdd ...; if the binary is on your PATH, the equivalent sdd ... commands work too.)
What to expect:
sdd showis the preferred preview command.- SVG is the default output format.
- PNG is available with
--format png. simpleis the best starting profile for early diagrams and drafts.
Profiles In Plain Language
One of the options is --profile. Profiles are validation and display overlays, not different SDD languages. You do not rewrite your .sdd file to switch profiles. Instead, you choose how much completeness, governance, and optional display detail you want the toolchain to apply to the same source.
In practice:
simple: low-noise drafting and the best starting point for most new workpermissive: warning-first completeness when you want guidance without as much blockingstrict: strict governance and the current CLI default
simple is especially useful early because it emphasizes design structure without pushing as hard for fuller metadata, and it can reduce visual noise in supported rendering where configured.
For the fuller profile explanation, see profiles.md.
Public Commands At A Glance
This page focuses on the three public subcommands most people need:
sdd show <input> --view <view>sdd validate <input>sdd compile <input>
If you only remember one command from this page, make it sdd show.
Command Reference
sdd show
- Purpose: compile, validate, and generate a preview artifact for a chosen view.
- Use when: you want a visible result, want to share a diagram, or want to check how a document renders under a given profile.
- Invocation:
pnpm sdd show <input> --view <view> - Key inputs: an input
.sddfile and a required--view. - Common options:
--profile,--format, and--out. - Output: SVG by default, or PNG when
--format pngis provided.
By default, the profile is strict, but for getting started you should usually add --profile simple.
If you omit --out, sdd show writes the preview beside the input file using the default name <source>.<view>.<profile>[.<backend>].<format>. If you want the output somewhere specific, provide --out.
Examples:
pnpm sdd show bundle/v0.1/examples/outcome_to_ia_trace.sdd --view ia_place_map --profile simple
pnpm sdd show bundle/v0.1/examples/service_blueprint_slice.sdd --view service_blueprint --profile simple --out ./blueprint.svg
pnpm sdd show bundle/v0.1/examples/scenario_branching.sdd --view scenario_flow --profile simple --out ./scenario.svg
pnpm sdd show bundle/v0.1/examples/place_viewstate_transition.sdd --view ui_contracts --profile simple --out ./ui-contracts.svg
pnpm sdd show bundle/v0.1/examples/branching_journey.sdd --view journey_map --profile simple --out ./journey.svg
pnpm sdd show bundle/v0.1/examples/outcome_to_ia_trace.sdd --view ia_place_map --profile simple --format png --out ./outcome.pngAdvanced note: all six v0.1 preview views default to staged SVG/PNG backends. --backend legacy_graphviz_preview selects preserved Graphviz output, for example:
pnpm sdd show bundle/v0.1/examples/branching_journey.sdd --view journey_map --backend legacy_graphviz_preview --out ./journey-legacy.svgsdd validate
- Purpose: compile and validate a source
.sddfile against a chosen profile. - Use when: you want to check whether a document passes profile expectations, or you want to see what metadata or structure is still missing.
- Invocation:
pnpm sdd validate <input> - Key inputs: an input
.sddfile, with optional--profile. - Output: validation feedback and diagnostics in terminal output.
This is a good next step after drafting. A common pattern is to start by getting the structure right under simple, then move to permissive or strict as the document becomes more complete.
Examples:
pnpm sdd validate bundle/v0.1/examples/outcome_to_ia_trace.sdd --profile simple
pnpm sdd validate bundle/v0.1/examples/outcome_to_ia_trace.sdd --profile permissive
pnpm sdd validate bundle/v0.1/examples/outcome_to_ia_trace.sdd --profile strictsdd compile
- Purpose: compile a source
.sddfile to canonical graph JSON. - Use when: you want machine-readable compiled output, want to inspect the normalized graph shape, or need JSON for another tool.
- Invocation:
pnpm sdd compile <input> - Key inputs: an input
.sddfile. - Output: canonical JSON to
stdoutby default, or to a file when--outis provided.
If you are just inspecting the output, stdout is often enough. If you want to save or compare the result, use --out.
Examples:
pnpm sdd compile bundle/v0.1/examples/outcome_to_ia_trace.sdd
pnpm sdd compile bundle/v0.1/examples/outcome_to_ia_trace.sdd --out ./outcome.json --diagnostics jsonSupported Preview Views
The preview-ready views in the CLI today are:
ia_place_mapui_contractsservice_blueprintscenario_flowoutcome_opportunity_mapjourney_map
All six v0.1 views are preview-ready through sdd show.
Dense Journey Maps can remain difficult to trace. Residual crossings receive deterministic continuity bridges and renderer.routing.journey_map_unavoidable_crossing warnings; the artifact is still produced so the diagnosed topology can be reviewed.
Suggested Starter Flows
I Want A Diagram Quickly
Start with sdd show, use --profile simple, and stick with SVG unless you specifically need PNG.
pnpm sdd show bundle/v0.1/examples/outcome_to_ia_trace.sdd --view ia_place_map --profile simpleI Want To Check Whether My File Is In Good Shape
Start with sdd validate. Use simple for early drafts, then move to permissive or strict as the document matures.
pnpm sdd validate bundle/v0.1/examples/outcome_to_ia_trace.sdd --profile simpleI Want Structured JSON Output
Use sdd compile. Print to stdout for quick inspection, or use --out when you want a saved artifact.
pnpm sdd compile bundle/v0.1/examples/outcome_to_ia_trace.sdd --out ./outcome.jsonPractical Notes
- Use
pnpm sdd --helpfor SDD help. - Use
pnpm sdd help <command>for command-specific details. - Since the sdd command looks for files in the project root directory, file paths have to be specified, as seen in the examples above. When using the SDD command from within another directory, use
$PWDto point the command at the current directory without typing the path:pnpm sdd show $PWD/input.sdd --view service_blueprint --out $PWD/output.svg - When there are temp-directory permission problems in a WSL setup, rerun commands with
TMPDIR=/tmp.
Contract And Behavior Sources
- CLI command surface:
src/cli/program.ts - Profiles detail:
docs/toolchain/profiles.md - Preview behavior background:
docs/toolchain/architecture.md - Main README quick-start context:
README.md