d2lang

    d2lang/d2

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

    25.8K stars
    777 forks
    77 GitHub watchers
    Updated Nov 8, 2026
    View on GitHub

    Build with Backblaze B2

    SDKs, agent skills, IDE extensions, and reference pipelines from Backblaze Labs. All open source.

    Explore Backblaze Labs

    Loading star history...

    Where it stands

    Rank, growth pace and release cadence relative to everything GStars tracks.

    2 releases in the last 90 days, the latest 62 days ago, with 66 contributors on GitHub.

    Peaked at #56 in the weekly ranking the week of Oct 19, its best in the past year.

    Use Cases & Benefits

    • Transforms textual scripts into visual diagrams using a modern, extensible diagram scripting language.
    • Enables fast, customizable diagram generation with multiple layout engines and export formats, supporting live reload and rich language tooling.
    • Use for creating software architecture diagrams programmatically with Go integration and plugin-based layout engines.
    • Use for embedding diagram generation in documentation workflows via VSCode, Vim, Obsidian, and Markdown plugins.
    • Use for visualizing database schemas, network topologies, or system workflows with text-to-diagram conversion and theme customization.

    Should you depend on it?

    License terms, project hygiene and risks, from GitHub metadata and GStars' snapshots.

    License

    Mozilla Public License 2.0

    Weak copyleft: changes to the licensed code itself must be shared when you distribute it, but code that merely uses it can stay under your own license.

    Community files

    • README: present
    • Contributing guide: present
    • Code of conduct: present

    Watch-outs

    No watch-outs from GStars' checks.

    General guidance from repository metadata, not legal advice. How we score

    From the README

    For more examples, see ./docs/examples.

    The most convenient way to use D2 is to just run it as a CLI executable to produce SVGs from .d2 files.

    A browser window will open with out.svg and live-reload on changes to in.d2.

    The easiest way to install is with our install script:

    You can run the install script with --dry-run to see the commands that will be used to install without executing them.

    Or if you have Go installed you can install from source though you won't get the manpage:

    You can also install a release from source which will include manpages. See ./docs/INSTALL.md#source-release.

    For detailed installation docs, see ./docs/INSTALL.md. We demonstrate alternative methods and examples for each OS.

    As well, the functioning of the install script is described in detail to alleviate any concern of its use. We recommend using your OS's package manager directly instead for improved security but the install script is by no means insecure.

    Excerpt from the d2lang/d2 README on GitHub (MPL-2.0 license). © its authors.Read the full README on GitHub

    Daily snapshots

    Stars gained per day, and how forks and open issues moved, from GStars' daily snapshots

    Forks

    777+58

    Open issues

    543-1

    Compared with peers in Developer Tools

    Fastest-growing repositories GStars tracks in this cohort for the week of Nov 8, by 7-day star growth

    d2lang/d2 compared with Developer Tools repositories by stars, 7-day star growth, health score and last release
    RepositoryStars+7dHealthLast release
    stablyai/orca121.4K+6.7K75today
    DietrichGebert/ponytail188.4K+4.4K7512 days ago
    affaan-m/ECC300.8K+4.3K7540 days ago
    herdrdev/herdr50.0K+2.1K7527 days ago
    max-sixty/worktrunk12.4K+1.9K7521 days ago
    d2lang/d225.8K—6262 days ago
    Category median121.4K+4.3K75—

    Discover Repositories

    Search across tracked repositories by name or description