[
{
"kind": "Bool",
"env": "D2_WATCH",
"name": "watch",
"short": "w",
"default": "false",
"usage": "watch for changes to input and live reload. Use $HOST and $PORT to specify the listening address.\n(default localhost:0, which will open on a randomly available local port)."
},
{
"kind": "String",
"env": "HOST",
"name": "host",
"short": "h",
"default": "localhost",
"usage": "host listening address when used with watch"
},
{
"kind": "String",
"env": "PORT",
"name": "port",
"short": "p",
"default": "0",
"usage": "port listening address when used with watch"
},
{
"kind": "Bool",
"env": "D2_BUNDLE",
"name": "bundle",
"short": "b",
"default": "true",
"usage": "when outputting SVG, bundle all assets and layers into the output file"
},
{
"kind": "Bool",
"env": "",
"default_env": "D2_ALLOW_PRIVATE_NETWORK",
"name": "allow-private-network",
"short": "",
"default": "false",
"usage": "allow remote image assets to access private, loopback, and link-local networks. Only enable this for trusted diagrams. Can also be set with $D2_ALLOW_PRIVATE_NETWORK"
},
{
"kind": "Bool",
"env": "D2_FORCE_APPENDIX",
"name": "force-appendix",
"short": "",
"default": "false",
"usage": "an appendix for tooltips and links is added to PNG exports since they are not interactive. --force-appendix adds an appendix to SVG exports as well"
},
{
"kind": "Bool",
"env": "DEBUG",
"name": "debug",
"short": "d",
"default": "false",
"usage": "print debug logs."
},
{
"kind": "Bool",
"env": "IMG_CACHE",
"name": "img-cache",
"short": "",
"default": "true",
"usage": "in watch mode, images used in icons are cached for subsequent compilations. This should be disabled if images might change."
},
{
"kind": "String",
"env": "D2_LAYOUT",
"name": "layout",
"short": "l",
"default": "dagre",
"usage": "the layout engine used"
},
{
"kind": "Int64",
"env": "D2_THEME",
"name": "theme",
"short": "t",
"default": "0",
"usage": "the diagram theme ID"
},
{
"kind": "Int64",
"env": "D2_DARK_THEME",
"name": "dark-theme",
"short": "",
"default": "-1",
"usage": "the theme to use when the viewer's browser is in dark mode. When left unset -theme is used for both light and dark mode. Be aware that explicit styles set in D2 code will still be applied and this may produce unexpected results. We plan on resolving this by making style maps in D2 light/dark mode specific. See https://github.com/d2lang/d2/issues/831."
},
{
"kind": "Int64",
"env": "D2_PAD",
"name": "pad",
"short": "",
"default": "100",
"usage": "pixels padded around the rendered diagram"
},
{
"kind": "Int64",
"env": "D2_ANIMATE_INTERVAL",
"name": "animate-interval",
"short": "",
"default": "0",
"usage": "if given, multiple boards are packaged as 1 SVG which transitions through each board at the interval (in milliseconds). Can only be used with SVG or GIF exports. For GIF exports, defaults to 1000ms if not specified."
},
{
"kind": "Int64",
"env": "D2_TIMEOUT",
"name": "timeout",
"short": "",
"default": "120",
"usage": "the maximum number of seconds that D2 runs for before timing out and exiting. When rendering a large diagram, it is recommended to increase this value"
},
{
"kind": "Bool",
"env": "",
"name": "version",
"short": "v",
"default": "false",
"usage": "get the version"
},
{
"kind": "Bool",
"env": "D2_SKETCH",
"name": "sketch",
"short": "s",
"default": "false",
"usage": "render the diagram to look like it was sketched by hand"
},
{
"kind": "Bool",
"env": "D2_ISOMETRIC",
"name": "isometric",
"short": "",
"default": "false",
"usage": "render SVG, PNG, GIF, PDF or PPTX in isometric perspective, preserving the compiled layout; also configurable through vars.d2-config.isometric"
},
{
"kind": "String",
"env": "",
"name": "stdout-format",
"short": "",
"default": "",
"usage": "output format when writing to stdout (svg, png, ascii, txt, pdf, pptx, gif). Usage: d2 input.d2 --stdout-format svg - > output.svg"
},
{
"kind": "String",
"env": "BROWSER",
"name": "browser",
"short": "",
"default": "",
"usage": "browser executable that watch opens. Setting to 0 opens no browser."
},
{
"kind": "Bool",
"env": "D2_CENTER",
"name": "center",
"short": "c",
"default": "false",
"usage": "center the SVG in the containing viewbox, such as your browser screen"
},
{
"kind": "Float64",
"env": "SCALE",
"name": "scale",
"short": "",
"default": "-1",
"usage": "scale the output. E.g., 0.5 to halve the default size. Default -1 means that SVG's will fit to screen and all others will use their default render size. Setting to 1 turns off SVG fitting to screen."
},
{
"kind": "String",
"env": "",
"name": "target",
"short": "",
"default": "*",
"usage": "target board to render. Pass an empty string to target root board. If target ends with '*', it will be rendered with all of its scenarios, steps, and layers. Otherwise, only the target board will be rendered. E.g. --target='' to render root board only or --target='layers.x.*' to render layer 'x' with all of its children."
},
{
"kind": "String",
"env": "D2_FONT_REGULAR",
"name": "font-regular",
"short": "",
"default": "",
"usage": "path to .ttf file to use for the regular font. If none provided, Source Sans Pro Regular is used."
},
{
"kind": "String",
"env": "D2_FONT_ITALIC",
"name": "font-italic",
"short": "",
"default": "",
"usage": "path to .ttf file to use for the italic font. If none provided, Source Sans Pro Regular-Italic is used."
},
{
"kind": "String",
"env": "D2_FONT_BOLD",
"name": "font-bold",
"short": "",
"default": "",
"usage": "path to .ttf file to use for the bold font. If none provided, Source Sans Pro Bold is used."
},
{
"kind": "String",
"env": "D2_FONT_SEMIBOLD",
"name": "font-semibold",
"short": "",
"default": "",
"usage": "path to .ttf file to use for the semibold font. If none provided, Source Sans Pro Semibold is used."
},
{
"kind": "String",
"env": "D2_FONT_MONO",
"name": "font-mono",
"short": "",
"default": "",
"usage": "path to .ttf file to use for the monospace font. If none provided, Source Code Pro Regular is used."
},
{
"kind": "String",
"env": "D2_FONT_MONO_BOLD",
"name": "font-mono-bold",
"short": "",
"default": "",
"usage": "path to .ttf file to use for the monospace bold font. If none provided, Source Code Pro Bold is used."
},
{
"kind": "String",
"env": "D2_FONT_MONO_ITALIC",
"name": "font-mono-italic",
"short": "",
"default": "",
"usage": "path to .ttf file to use for the monospace italic font. If none provided, Source Code Pro Italic is used."
},
{
"kind": "String",
"env": "D2_FONT_MONO_SEMIBOLD",
"name": "font-mono-semibold",
"short": "",
"default": "",
"usage": "path to .ttf file to use for the monospace semibold font. If none provided, Source Code Pro Semibold is used."
},
{
"kind": "Bool",
"env": "D2_CHECK",
"name": "check",
"short": "",
"default": "false",
"usage": "check that the specified files are formatted correctly."
},
{
"kind": "Bool",
"env": "D2_NO_XML_TAG",
"name": "no-xml-tag",
"short": "",
"default": "false",
"usage": "omit XML tag (<?xml ...?>) from output SVG files. Useful when generating SVGs for direct HTML embedding"
},
{
"kind": "String",
"env": "",
"name": "salt",
"short": "",
"default": "",
"usage": "Add a salt value to ensure the output uses unique IDs. This is useful when generating multiple identical diagrams to be included in the same HTML doc, so that duplicate IDs do not cause invalid HTML. The salt value is a string that will be appended to IDs in the output."
},
{
"kind": "Bool",
"env": "OMIT_VERSION",
"name": "omit-version",
"short": "",
"default": "false",
"usage": "omit D2 version from generated image"
},
{
"kind": "String",
"env": "D2_ASCII_MODE",
"name": "ascii-mode",
"short": "",
"default": "extended",
"usage": "ASCII rendering mode for text outputs. Options: 'standard' (basic ASCII chars) or 'extended' (Unicode chars)"
},
{
"kind": "Int64",
"env": "",
"name": "dagre-nodesep",
"short": "",
"default": "60",
"usage": "number of pixels that separate nodes horizontally.",
"hidden": true
},
{
"kind": "Int64",
"env": "",
"name": "dagre-edgesep",
"short": "",
"default": "20",
"usage": "number of pixels that separate edges horizontally.",
"hidden": true
},
{
"kind": "String",
"env": "",
"name": "elk-algorithm",
"short": "",
"default": "layered",
"usage": "layout algorithm",
"hidden": true
},
{
"kind": "Int64",
"env": "",
"name": "elk-nodeNodeBetweenLayers",
"short": "",
"default": "70",
"usage": "the spacing to be preserved between any pair of nodes of two adjacent layers",
"hidden": true
},
{
"kind": "String",
"env": "",
"name": "elk-padding",
"short": "",
"default": "[top=50,left=50,bottom=50,right=50]",
"usage": "the padding to be left to a parent element\u2019s border when placing child elements",
"hidden": true
},
{
"kind": "Int64",
"env": "",
"name": "elk-edgeNodeBetweenLayers",
"short": "",
"default": "40",
"usage": "the spacing to be preserved between nodes and edges that are routed next to the node\u2019s layer",
"hidden": true
},
{
"kind": "Int64",
"env": "",
"name": "elk-edgeEdgeBetweenLayers",
"short": "",
"default": "50",
"usage": "the spacing to be preserved between pairs of edges routed between the same pair of layers",
"hidden": true
},
{
"kind": "Int64",
"env": "",
"name": "elk-nodeSelfLoop",
"short": "",
"default": "50",
"usage": "spacing to be preserved between a node and its self loops",
"hidden": true
},
{
"kind": "Int64Slice",
"env": "",
"name": "tala-seeds",
"short": "",
"default": "1,2,3",
"usage": "random seeds for deterministic TALA layout attempts; the best complete result is selected.",
"hidden": true
}
]