The last question in the FAQ makes it clear that this can only be used in the context of their account-based online tool. Their free offering literally says "3 diagrams". Above this, the FAQ tries to compare their tool to Mermaid, Graphviz, PlantUML which are all open source, locally runnable, etc. Their comparison totally skips the fact that, because D2 can only be used in their service, a broad number of use cases (including programmatically generating diagrams inside some other application) basically aren't supported.

Seems like it could have been cool, but likely will not seriously try it because of these limits.

> Mermaid, Graphviz, PlantUML which are all open source, locally runnable, etc

And there's C4 Model for Visualising Architecture [0] that has upcoming tool support, for instance Structurizr DSL [1]. It has an online editor [2] that can export to Mermaid, PlantUML and other formats. And has various open source repo's, like this Java codebase for the DSL itself [3].

[0] https://c4model.com/

[1] https://structurizr.com/help/dsl

[2] https://structurizr.com/dsl

[3] https://github.com/structurizr/dsl