Skip to main content

D2 Tour (alpha)

D2 is a domain-specific language (DSL) that stands for Declarative Diagramming. Declarative, as in, you write in text what you want diagrammed, we generate it.

For example, you provide this input on the left, and you get back the output on the right.

declarative diagramming example

You can finish this tour in about 5-10 minutes, and at the end, there's a cheat sheet you can download and refer to. If you want just the bare essentials, "Getting Started" takes ~2 mins.


It's currently in alpha. During this time, it's only housed on Terrastruct, which provides the most well-supported interface (IDE) for it. Once we have a stable v1, we'll release and continue development of it in open source and make local options available.

See future plans for more.


The D2 language is experimental. Stability and backwards compatibility is not guranteed.