macOS
brew install d2local Homebrew formula metadata
sudo port install d2MacPorts ports tree · graphics/d2/Portfile · source: api.github.com
brew
Modern diagram scripting language that turns text to diagrams. Version 0.7.1 via Homebrew; verified from local package data.
install
brew install d2local Homebrew formula metadata
sudo port install d2MacPorts ports tree · graphics/d2/Portfile · source: api.github.com
sudo dnf install d2Fedora Rawhide package metadata · d2 · source: dl.fedoraproject.org
nix profile install nixpkgs#d2nixpkgs package indexes · pkgs/by-name/d2/d2/package.nix · source: api.github.com
sudo pacman -S d2Arch Linux sync databases · d2 · source: geo.mirror.pkgbuild.com
sudo zypper install d2openSUSE Tumbleweed package metadata · d2 · source: download.opensuse.org
scoop install main/d2Scoop official bucket manifest trees · bucket/d2.json · source: api.github.com
winget install --id Terrastruct.D2 -eWindows Package Manager source index · Terrastruct.D2 · source: cdn.winget.microsoft.com
overview
Modern diagram scripting language that turns text to diagrams
history
D2 is a modern diagram scripting language and CLI that turns text files into diagrams, especially for software architecture and documentation workflows.
The D2 repository was created in 2022 by Terrastruct. The README presents D2 as a language, command-line renderer, and Go library, with official documentation, a playground, themes, language tooling, plugins, and export formats.
D2 entered the diagram-as-code ecosystem as another text-to-diagram option alongside tools such as Graphviz and Mermaid. Its README emphasizes package-manager installation, editor/tooling support, and a list of open-source projects that document with D2.
The usual workflow is to write a .d2 file and run the d2 CLI to produce SVG, PNG, or PDF output. D2 can also be used as a Go library and can swap layout engines such as ELK or TALA.
D2 is package-manager friendly because it ships as a single CLI for docs pipelines: install it with a system package manager, keep diagrams as source text, and regenerate images in builds or documentation sites.
security posture
generalized runtime or code generation signal.
yellow risk · medium confidence · runtime
Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.
executables
| Command | Kind | Exposure | Note |
|---|---|---|---|
d2 | cli | global executable |
freshness
These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.
https://github.com/terrastruct/d2
install metadata
| Package key | brew:d2 |
|---|---|
| Version | 0.7.1 |
| Package manager | Homebrew |
| Package manager page | https://formulae.brew.sh/formula/d2 |
| Homepage | https://d2lang.com/ |
| Repository | https://github.com/terrastruct/d2 |
| Upstream docs | https://d2lang.com/ |
| License | MPL-2.0 |
| Source archive | https://github.com/terrastruct/d2/archive/refs/tags/v0.7.1.tar.gz |
| Build dependencies | go |
| Bottle | available (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux) |
| Homebrew post-install | not defined |
| Service | none declared |
registry facts
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | d2 |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
source database matches
Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.
d2
nix profile install nixpkgs#d2d2 0.6.9-8.fc44
Modern diagram scripting language that turns text to diagrams
https://github.com/terrastruct/d2
sudo dnf install d2d2 0.7.1-2
A modern diagram scripting language that turns text to diagrams
sudo pacman -S d2d2 0.7.1-1.4
CLI tool and modern declarative language that turns text to diagrams
https://github.com/terrastruct/d2
sudo zypper install d2d2
sudo port install d2main/d2
scoop install main/d2Terrastruct.D2
winget install --id Terrastruct.D2 -esource trail
This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.
View the package source record on GitHub.