spinagram
Tools

CLI

Every command, option and environment variable.

spinagram render specs/ --theme ../my-theme -f svg,png,pptx,figma -o out/
spinagram check specs/ --theme ../my-theme        # text overflow and layout report
spinagram check specs/ --styles --select .critical # why elements look the way they do
spinagram render specs/ --tag kubernetes           # only diagrams tagged kubernetes
spinagram facts specs/                             # facts used, per diagram
spinagram layout spec.yaml -o frozen.yaml          # freeze automatic positions
spinagram serve specs/                             # live-reload UI
spinagram icons search "load balancer"             # icon pack management
spinagram vectorize icons/ -o vector/              # trace PNG icons into SVG
spinagram deck deck.yaml -o slides.html            # HTML presentation
spinagram skills install --agent claude            # agent skills, see AI agent skills
spinagram mcp install -a claude                    # MCP server for agents, see MCP server
spinagram mcp --http 8766                          # the MCP server over streamable HTTP
python -m spinagram render specs/                  # the same CLI from any Python with spinagram

paths are spec files or directories (*.yaml, *.py). A _defaults.yaml in a directory sets defaults for every spec in it.

OptionCommandsMeaning
-t, --themerender, check, facts, layout, deck, serveTheme directory or name, see Themes by name (env SPINAGRAM_THEME)
--only ID...render, check, facts, layoutDiagram ids to include
--tag TAGrender, check, facts, layoutOnly diagrams with this tag, declared or inferred from icons; repeat to require several
--category NAMErender, check, facts, layoutOnly diagrams in this category (case-insensitive)
--layout ENGINErender, check, facts, layout, serveEngine for specs with layout: (flex, dot, elk, d2; env SPINAGRAM_LAYOUT)
-f, --formatsrenderComma list from svg, png, pptx, figma, figjam, excalidraw
-o, --outrender, layout, vectorize, deckOutput directory or file
--no-galleryrenderSkip index.html
--fonts subset|embed|linkrenderSVG and PNG fonts: subset (default) embeds only the characters drawn, embed the whole font files, link none (a Google Fonts @import) (details)
--stylescheckExplain each element's computed style: matching rules, overrides, inheritance (details)
--select SELECTORcheckWith --styles or --json: only elements matching a CSS selector
--jsoncheckPrint the style report as JSON
--color auto|always|nevercheckColour the style report (auto: a terminal without NO_COLOR)

What check reports

KindMeaning
overflow-x, overflow-yText wider or taller than its box
layout: overflowThe automatic layout does not fit its area
labelAn edge label hides an arrowhead, or covers a box
edgeAn edge is drawn through a box it does not connect
styleA stylesheet error, an unknown property or a font the theme does not embed
behaviorA decision with one branch, a fork with one branch, a state region without an initial state
legend, steps, callout, annotationsAnnotation problems, see Annotations
edge-crosses-zone-header, icon-overlaps-textAn edge through a zone header, an icon over its box's text (P0)
text-scale-mismatch, icon-generic-for-service, glyph-mappedUneven text sizes in a row, a generic icon on a named cloud service, a character replaced by the theme glyph map (P2)

Hand-placed diagrams get the layout checks too (zone-underused, edge-crossings, …); the Layout engine guide lists every kind, its severity and its fix.

check exits non-zero when it finds anything, so it can gate a pull request.

mcp

OptionMeaning
-t, --layout, --formatsDefaults for every tool call (--formats is a comma list; default svg,png)
--root DIRFolder every tool path must stay inside (default: the current folder)
--http PORT, --hostServe streamable HTTP at http://HOST:PORT/mcp instead of stdio (host default 127.0.0.1)

spinagram mcp install writes the server into an agent's config. See MCP server for both.

Environment variables

VariableEffect
SPINAGRAM_THEMEDefault theme
SPINAGRAM_THEME_PATHDirectories searched for themes by name (<dir>/<name>/theme.yaml), separated by : (; on Windows)
SPINAGRAM_LAYOUTDefault layout engine override
SPINAGRAM_CACHECache directory for icon packs (default ~/.cache/spinagram)
SPINAGRAM_OFFLINE=1Never download icon packs
SPINAGRAM_ICON_PACKSExtra icon pack registry file
SPINAGRAM_VECTORIZE=0Do not trace PNG icons into SVG
SPINAGRAM_PPTX_SVG=rasterPowerPoint gets PNG icons only

On this page