Structurizr DSL


The Structurizr DSL (as mentioned on the ThoughtWorks Tech Radar - Techniques - Diagrams as code) allows you to create multiple diagrams based upon the C4 model, in multiple output formats, from a single DSL source file. There are a number of options for authoring workspaces with the Structurizr DSL.

Structurizr Lite

Packaged as a Docker container, and designed for developers, Structurizr Lite provides a way to quickly work with a single workspace. It's free to use, and allows you to view/edit diagrams, view documentation, and view architecture decision records defined in a DSL workspace.

Structurizr CLI

The Structurizr CLI is a command line utility, designed to be used in conjunction with the Structurizr DSL. It provides the ability to push/pull workspaces to/from the Structurizr cloud service or an on-premises installation, in additional to exporting the views defined in a DSL file to other formats (PlantUML, Mermaid, WebSequenceDiagrams, and Ilograph).

The CLI provides access to the full feature set offered by the Structurizr cloud service/on-premises installation and Structurizr DSL. See Getting started with the Structurizr CLI and DSL for more information.

DSL editor

If you'd rather not use the CLI, the Structurizr cloud service/on-premises installation provides an online DSL editor. The editor provides some basic syntax highlighting and the ability to use the DSL without installing the Structurizr CLI, but it does not provide access to the full feature set offered by the Structurizr cloud service/on-premises installation and Structurizr DSL - see the comparison table below.

The DSL editor can be opened using the link on your workspace summary page.

Comparison

Structurizr Lite Structurizr CLI DSL editor (and demo page)
Diagrams
Documentation !docs
Architecture decision records !adrs
Branding logo logo HTTPS URLs (important notes) and data URIs only
Element style icons icon HTTPS URLs (important notes) and data URIs only
Workspace extension extends HTTPS URLs only
DSL includes !include HTTPS URLs only
Plugins !plugin
Scripts !script
Export to PlantUML, Mermaid, DOT, WebSequenceDiagrams, and Ilograph Demo page only

Real-time collaboration

The DSL editor also supports real-time collaboration, which can be opened using the link on your workspace summary page.

Paid feature (not available with a free or basic subscription)

Anybody who has owner, admin, or read-write role-based access to your workspace can click the same button to join your collaboration session. The collaborative editor currently functions as follows:

  • DSL source is synchronized in real-time.
  • Each user can click the "Render" button to render the DSL as one or more diagrams.
  • Clicking the "Save workspace" button will save the DSL definition, and automatically reload the diagrams for each collaborator.

At the moment, diagram layout changes (moving elements, adding vertices to relationships, etc) are not synchronized until the workspace is saved. This feature may be added at a later date.


Collaborative DSL editor