Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI reference

The structurizrx binary (package structurizr-cli) accepts both .dsl and .json workspace files for every subcommand that takes a file argument.

CommandWhat it does
validateParse + validate; --strict also fails on lint findings; --json emits structured output
lintModel hygiene: blocking findings, warnings and dependency cycles
renderExport diagrams (materializes generated views first)
serveLive-reloading web viewer with a JSON API
digestCompact plain-text model + view summary, sized for LLM context
queryRun a selector expression against a workspace
locateFind where elements, relationships and views are declared, by path or from a viewer link
diffCompare two versions of a workspace as models
clustersCommunity/coupling analysis: conformance findings, cycles, bridges, metrics
graphThe whole workspace as one graph, as JSON or DOT
fmtCanonical DSL text: JSON→DSL, sketch→workspace, --check/--write
add/remove/renameSurgical, re-parse-checked edits to DSL source
exportWorkspace JSON (superset of the Structurizr JSON schema)
export-siteSingle-page SVG technical report
export-viewerPortable interactive viewer with bundled assets and workspace JSON
mcpServe these commands as MCP tools over stdio
docsPrint the DSL cheat sheet

There’s also structurizrx lsp, which runs the DSL language server over stdio for editor integration (see the VS Code extension under editors/vscode in the repository) — it has no user-facing flags and isn’t covered further here.

Global behavior

  • --version prints the binary version; --help (or a subcommand’s --help) prints usage.
  • File loading picks the DSL parser or the JSON deserializer based on the file extension (.json vs anything else, treated as DSL).