The CLI converts diagram sources into .drawio, SVG, or imported YAML bundles.
node skills/drawio/scripts/cli.js <input> [output] [options]
| Input | How to use it |
|---|---|
| YAML | default input format |
| Mermaid | --input-format mermaid |
| CSV | --input-format csv |
.drawio |
--input-format drawio --export-spec |
| stdin | use - as the input path |
| Flag | Description |
|---|---|
--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-spec |
Export canonical YAML instead of rendering XML/SVG |
--write-sidecars |
Emit .spec.yaml and .arch.json next to the output |
--use-desktop |
Use draw.io Desktop for PNG, PDF, JPG, or embedded SVG exports |
--validate |
Print spec warnings and run XML validation |
--strict |
Fail on validation warnings and strict complexity errors |
--strict-warnings |
Alias of --strict |
| Output | Result |
|---|---|
| no output path | XML to stdout |
.drawio |
draw.io XML file |
.svg |
standalone SVG |
.png |
desktop export |
.pdf |
desktop export |
.jpg |
desktop export |
.drawio bundlenode skills/drawio/scripts/cli.js input.yaml output.drawio --validate --write-sidecars
node skills/drawio/scripts/cli.js input.yaml output.svg --validate --write-sidecars --strict-warnings
node skills/drawio/scripts/cli.js input.yaml output.drawio --theme high-contrast
.drawio filenode skills/drawio/scripts/cli.js existing.drawio --input-format drawio --export-spec --write-sidecars
node skills/drawio/scripts/cli.js flow.mmd output.drawio --input-format mermaid --validate
--validate reports two layers:
Use --strict or --strict-warnings when those warnings should block the output.