25,600 stars · MPL-2.0 · v0.9.0 (2026-09-07) · Track this in Scout
A short text file becomes a finished diagram, so a picture can be kept beside the code and reviewed like code.
▶Repo detailsthe review · specs · pros & cons · install
What it is
D2 is a small language for describing diagrams, plus a program that reads that language and writes out the picture. It was written by a company called Terrastruct and it is now installed as a single downloaded file.
What it is good for. Anyone who has to keep a diagram up to date. A drawing made by hand in a graphical editor goes stale the moment the thing it describes changes, and nobody can tell from looking at it what was altered. A diagram written as text sits in the same place as the code, and a change to it shows up as a few changed lines that a person can read. It suits architecture pictures, sequence pictures and anything with more than about five boxes.
- The news of the day. Release v0.9.0, dated 7 September 2026, says in its own words: "TALA is now open source and bundled with D2, including the JavaScript/WASM package" and "No separate plugin installation or license key is required." TALA is the layout engine Terrastruct wrote itself, and until then it needed a token from a paid account. Its own repository at terrastruct/TALA (292 stars) still says the opposite — "TALA is closed-source" — and still describes needing an API token to leave evaluation mode, or diagrams come out with a watermark across them. The release notes are five weeks newer than that page.
- Three layout engines are now included and you pick one with a flag:
--layout=dagre,--layout=elkor--layout=tala. The same drawing can be re-arranged three different ways without changing a line of your text. - The same release reports that drawing is about ten times faster across its own test set, that real diagrams compile about three times faster at the middle of the range, and that the output files are about 24% smaller. Export to PNG, GIF, PDF and PowerPoint is built in.
- 476 open issues against 54 open pull requests. That is a large waiting list for a project of this size, and it is worth knowing before you build a workflow on it.
- The licence file is at
/blob/master/LICENSE.txt. The ordinaryLICENSE,LICENSE.mdandCOPYINGpaths all return a 404 error, so automatic licence checkers find nothing. The file itself is the Mozilla Public License 2.0 (a licence that lets you use and sell the software freely, but asks you to publish your changes to D2's own files), with the line "Copyright 2022 Terrastruct Inc." sitting above the licence header. The body is unmodified. - The documented install pipes a script from the internet straight into a shell, which runs whatever that script contains. The project's own README says "We recommend using your OS's package manager directly instead for improved security", and that advice is worth taking.
mermaid-js/mermaidAlso turns text into diagrams and is far more widely supported, because GitHub, GitLab and most note apps render it without any install, but its layout is less able to untangle a dense architecture picture.
Track this in Scout- plantuml/plantuml
The oldest text-to-diagram tool of the three, covering more diagram types than either, but it needs Java installed and its output looks noticeably more dated.
Track this in Scout
jgraph/drawioThe editor behind diagrams.net, and the opposite approach: you drag shapes with a mouse, which is quicker for one picture and much worse for keeping fifty of them current.
Track this in Scout
# the install script the README leads with curl -fsSL https://d2lang.com/install.sh | sh -s -- # or, if Go is already on the machine go install github.com/d2lang/d2@latest # then d2 --layout=tala input.d2 out.svg d2 layout # lists the three engines

