d2 Command Examples

A modern diagram scripting language that turns text to diagrams. Note: the output file supports SVG and PNG file formats. More information: https://d2lang.com/tour/man.

d2 {{path/to/input_file.d2}} {{path/to/output_file.ext}}

d2 --watch {{path/to/input_file.d2}} {{path/to/output_file.ext}}

d2 fmt {{path/to/input_file.d2}}

d2 themes

d2 --theme {{theme_id}} {{path/to/input_file.d2}} {{path/to/output_file.ext}}

d2 --sketch true {{path/to/input_file.d2}} {{path/to/output_file.ext}}