# d2lang/d2

D2 is a modern diagram scripting language that turns text to diagrams.

Repository: https://github.com/d2lang/d2
Canonical: https://ross.abutalabs.com/products/d2
Homepage: https://d2lang.com
Language: Go
License: MPL-2.0
License Family: copyleft
Topics: diagramming, diagrams, text-to-diagram, software-architecture, go, golang, developer-tools
Last push: 2026-08-25T00:08:49+00:00

## Health v2 (maintenance only)
Score: 76/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 32, longevity 100
- inputs: {"age_days": 1458, "days_push": 9, "days_rel": 379, "gap_med": 87.0, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 25078, forks 730 (observed 2026-08-28T04:11:37.835776+00:00)

## What it is
D2 is a modern declarative diagram scripting language that turns plain text descriptions into diagrams. It ships as a CLI compiler with themes, multiple layout engines, and export formats like SVG, plus a library for embedding.

## Use cases
- generate architecture diagrams from text
- diagram as code for documentation
- convert d2 script to svg
- draw network diagrams declaratively
- create animated diagrams from text
- version-control software architecture diagrams

## When to choose
- you want diagrams maintained in version control as text
- you need polished, themed diagrams for docs, wikis, or presentations
- you want a fast text-to-diagram workflow with a CLI and playground

## When to avoid
- you need freehand or WYSIWYG diagram editing
- you require diagram formats D2 does not export
- you need a GUI-only diagramming tool for non-technical users

## Facets
- artifact type: cli-tool
- maturity: active
- function: programming-language, compiler, developer-tools, documentation, data-visualization
- domain: developer-tools, documentation
- platform: windows, cli, cross-platform
- tags: diagram-as-code, text-to-diagram, declarative-diagramming, architecture-diagrams, sketch-mode, animated-diagrams, diagrams, software-architecture, linux, macos

## Member repositories
- d2lang/d2 (main) score 76

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:37.835776+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T16:56:06.583802+00:00, confidence not recorded.
  - readme: https://github.com/d2lang/d2 (fetched 2026-08-28T04:11:37.835776+00:00, sha 878d0a32b9b1)
  - homepage: https://d2lang.com (fetched 2026-08-29T07:53:09.012970+00:00, sha 69523d9e21ab)
  - site_page: https://d2lang.com/releases/intro (fetched 2026-08-29T07:53:09.016141+00:00, sha 0d369d7bc58e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
