Skip to content

Command line renderer ​

Render TextGraph files into PNG or SVG with the packaged Node.js CLI. Output uses the light palette by default; add --dark for a native dark image.

Install ​

Use Node.js 22.12.0 or later.

bash
npm install --global @drawmotive/textgraph

Render a file ​

The output filename selects PNG or SVG.

bash
textgraph render diagram.textgraph --output diagram.png
textgraph render diagram.textgraph --output diagram-dark.png --dark
textgraph render diagram.textgraph --output diagram-dark.svg --dark

Read source from standard input with -:

bash
printf 'client -> api -> database\n' | textgraph render - --output diagram.png

Options ​

OptionBehavior
--output <file>, -o <file>Required destination ending in .png or .svg. Its directory must already exist.
--darkRender the native dark palette. Omit for light output.
--language <tag>Select a language tag such as ja, zh-CN, or zh-TW.
--help, -hShow command usage.

Success prints the saved filename and exits with code 0. Diagnostics go to standard error. Invalid source, arguments, or operational failures exit with code 1; a failed diagram render preserves any existing output file.

Appearance ​

--dark changes the rendered colors in the output file. Layout, labels, and diagram dimensions stay the same. Omit the flag for a light image.

For application code, use the JavaScript SDK. For interactive previews and PNG downloads, use the Playground.