Your first .em.hcl model
Install the CLI, write a small model, validate it, and render it locally.
1 · Install the CLI
Download a release archive, or build from source with Go 1.25 or newer.
Option A: download a release
Swap linux_amd64 for darwin_amd64, darwin_arm64, linux_arm64, windows_amd64, or windows_arm64 as needed, and the version number for whatever the releases page currently lists. With GitHub CLI 2.49.0 or newer, you can also verify the archive was actually produced by this repository's release workflow:
Option B: build from source
Either way, confirm it runs:
2 · Write your first model
Save this as pet.em.hcl. It's the same minimal model used throughout this site — one bounded context, one Event, one State Change workflow:
3 · Validate it
A valid document prints:
A diagnostic instead would look like file:line:column: Severity EMxxx: message. See the quality page for what's a hard error versus a warning worth a second look.
4 · Render the canvas
pet.html is a single self-contained file — no external dependencies, no build step. Open it directly in a browser.
Optional: publish the diagram
The model and rendered canvas are files, so you can commit them beside the code and host the canvas with GitHub or GitLab Pages:
Keeping the model in the repository means it can be versioned and reviewed with the code.
Using a coding agent? It can draft, validate, fix, and render a model before human review. See Using .em.hcl with coding agents.