Small, focused repo for authoring D2 diagrams. Sources live in diagram/ and exports are written to output/ via small helper scripts and mise tasks.
- Kubernetes Icons
- AWS Icons
- Azure Icons
- GCP Icons
- IBM Icons
- Dashboard Icons (dashboardicons)
- Dashboard Icons (selfh.st)
- Software Architecture Diagram Icons
- CNCF Logos
Prereqs: Docker + VS Code.
- Open this repo in VS Code and run: "Dev Containers: Reopen in Container".
- The container will run
scripts/setup.shto install D2 and Playwright (for PNG export). - Start watching a diagram and auto-regenerate SVG on save:
mise run watch ./path/to/diagram- Build all outputs on demand:
mise run build ./path/to/diagramWatch mode writes ./output/diagram.svg.
Build mode writes ./output/diagram.svg, ./output/diagram.png, and ./output/diagram.gif.
- Install mise: https://mise.jdx.dev
- Trust and install tools for this repo:
mise trust
mise install- Install D2 CLI if not present: https://d2lang.com/tour/install
- Install Playwright Chromium (required for PNG and GIF export):
npm -g install playwright
npx playwright install --with-deps chromiumNow you can use the same tasks:
mise run watch ./path/to/diagram
mise run build ./path/to/diagramPowerShell:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\d2_watch.ps1 ./diagram/homelab.d2
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\d2_build.ps1 ./diagram/homelab.d2Bash:
./scripts/d2_watch.sh ./diagram/homelab.d2
./scripts/d2_build.sh ./diagram/homelab.d2If this project helps you, consider supporting it:
- GitHub Sponsors: https://github.com/sponsors/HYP3R00T