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

Command Line

Render

xaligo render <file.xal> --format <format> -o <output>

Supported formats:

FormatOutput
excalidrawEditable Excalidraw JSON
svgStandalone SVG; one file per frame by default
pptxPowerPoint presentation; one slide per frame by default
pdfPDF document; one page per frame by default
excelExcel workbook; one frame SVG per worksheet by default
xlsxAlias for excel
xyflowReact Flow / XYFlow JSON
isoflowIsoflow-compatible model JSON

UML input (<uml>...</uml>) currently rejects --format excalidraw because the editable UML Excalidraw export is disabled. Use svg, pdf, pptx, excel, xyflow, or isoflow for UML diagrams.

Frames and physical pages

Identified child frames are physical pages for SVG, PPTX, PDF, and Excel. They are emitted in source order.

FormatMultiple-frame default--combine-frames
SVGSeparate <output-stem>-<safe-frame-id>.svg filesOne SVG canvas
PPTXOne slide per frame in one presentationOne diagram slide
PDFOne page per frame in one documentOne PDF page
ExcelOne worksheet per frame in one workbookOne worksheet

Excalidraw, XYFlow, and Isoflow always remain one logical document, so --combine-frames does not change them. Live SVG preview also uses the combined canvas so every frame remains visible in one browser view.

For a one-frame SVG document, -o is the exact output filename. For several frames, -o output/diagram.svg produces names such as output/diagram-overview.svg and output/diagram-detail.svg. Safe frame IDs retain ASCII letters, digits, _, and -; other character runs become -. Leading and trailing - are removed, an empty result falls back to the frame’s source order, and a filename collision is an error. SVG output is not wrapped in an implicit ZIP archive.

Common render flags:

FlagDescription
`–mode standardnetwork
`–theme lightdark`
--services <csv>Service metadata and label overrides
`–svg-legend-position topright
`–arrow-style thinstandard
--combine-framesPreserve the compatibility single-canvas/page form for SVG, PPTX, PDF, and Excel

aws-2.5d and topology are recognized roadmap modes but currently return a not-implemented error. Any other mode, format, theme, orientation, paper size, arrow-style option, or SVG legend-position value outside its documented enum returns an error.

--arrow-style belongs to the shared physical Plan used by SVG, PPTX, PDF, and Excel. The editable Excalidraw, XYFlow, and Isoflow V1 outputs consume the resolved DSL scene directly and therefore use the DSL connection defaults instead.

Physical-page and PPTX flags:

FlagDescription
`–paper A5A4
`–orientation portraitlandscape`
--paper-margin <inches>Margin applied before fitting
--paper-margin-top/right/bottom/left <inches>Per-side margin override
--px-per-inch <number>Layout scaling base
--title, --author, --company, --subjectPPTX presentation metadata
`–compression truefalse`

--title sets package-level PPTX metadata. It is unrelated to the visible title attribute on a page <frame> and never creates a frame tag.

Structural Diff

xaligo diff before.xal after.xal -o output/architecture

The command compares parsed .xal data structures rather than source lines and writes two SVG images:

  • output/architecture-removed.svg renders the old document and highlights removed elements plus the old side of modified or moved elements in pale red.
  • output/architecture-added.svg renders the new document and highlights added elements plus the new side of modified or moved elements in pale green.

XML formatting, comments, attribute order, parser-private attributes, and the equivalent V1 forms with an omitted version or version="1" do not create a diff when that version is on the document root. A version on an identified child frame is visible page content and is compared normally, including the literal value 1. Matching prefers unique name, ref, and id values, then exact subtrees, followed by deterministic order-aware structural matching. Give elements an explicit id, name, or ref when moves must remain identifiable across different parents.

-o is an output prefix, not a single output filename. A trailing .svg is removed before -removed.svg and -added.svg are appended. The default prefix is output. --theme, --mode, and --px-per-inch are applied identically to both images. No difference is a successful result and still produces two unhighlighted SVGs.

See the structural diff sample for a complete before/after pair and the generated images.

Generate

Generate a starter .xal hierarchy:

xaligo generate xal -o generated.xal --paper A4 --orientation landscape

Useful generation flags:

FlagDefaultDescription
--clouds, --accounts, --regions, --azs1, 1, 1, 2AWS hierarchy counts
`–az-layout gridstaggered`grid
--subnets2Number of subnets
`–spacing verticalhorizontalboth`
`–start topleft`top
--paperA4Paper size
--orientationlandscapePage orientation

Only --output is required. The generated file uses the canonical <xaligo version="1"><frames>...</frames></xaligo> document envelope.

Other Commands

CommandDescription
xaligo diff <before.xal> <after.xal> -o <prefix>Render paired structural-diff SVGs
xaligo validate <file.xal>Validate syntax, layout, and connection references
xaligo render markdown <file.md>Embed rendered xal code blocks as SVG images into a Markdown file
xaligo serve <file.xal|file.md>Serve a live preview; .xal previews one combined SVG, .md/.markdown previews the full document with diagrams embedded inline; --port overrides the configured serve.port (default 8080), and --paper/--orientation fix the preview to a physical page size
xaligo add service --name <name> --file <file>Add a service icon
xaligo add service --list <csv> --file <file>Bulk-add service icons
xaligo init [-o <dir>]Generate a sample .xal file
xaligo versionPrint version