Skip to content

CLI Tool

The CLI converts diagram sources into .drawio, SVG, or imported YAML bundles.

Usage

bash
node skills/drawio/scripts/cli.js <input> [output] [options]

Inputs

InputHow to use it
YAMLdefault input format
Mermaid--input-format mermaid
CSV--input-format csv
.drawio--input-format drawio --export-spec
stdinuse - as the input path

Key Options

FlagDescription
--input-format <f>yaml, mermaid, csv, or drawio
--theme <name>Override the theme: tech-blue, academic, academic-color, nature, dark, high-contrast
--page <selector>Select a page by index or diagram name during drawio import
--export-specExport canonical YAML instead of rendering XML/SVG
--write-sidecarsEmit .spec.yaml and .arch.json next to the output
--use-desktopUse draw.io Desktop for PNG, PDF, JPG, or embedded SVG exports
--validatePrint spec warnings and run XML validation
--strictFail on validation warnings and strict complexity errors
--strict-warningsAlias of --strict

Output Formats

OutputResult
no output pathXML to stdout
.drawiodraw.io XML file
.svgstandalone SVG
.pngdesktop export
.pdfdesktop export
.jpgdesktop export

Examples

Render a .drawio bundle

bash
node skills/drawio/scripts/cli.js input.yaml output.drawio --validate --write-sidecars

Render a strict SVG

bash
node skills/drawio/scripts/cli.js input.yaml output.svg --validate --write-sidecars --strict-warnings

Override the theme

bash
node skills/drawio/scripts/cli.js input.yaml output.drawio --theme high-contrast

Import an existing .drawio file

bash
node skills/drawio/scripts/cli.js existing.drawio --input-format drawio --export-spec --write-sidecars

Convert Mermaid

bash
node skills/drawio/scripts/cli.js flow.mmd output.drawio --input-format mermaid --validate

Validation Output

--validate reports two layers:

  1. spec warnings
  2. XML validation results

Use --strict or --strict-warnings when those warnings should block the output.

Draw.io Skill v2.2.0 documentation.