https://d2lang.com/tour/intro/ Skip to main content D2D2 TourBlogExamplesReleases Playgroundgithub logodiscord logo Search * Introduction + What is D2 + Dev tool vs design tool + Design decisions + Getting help & community + Roadmap * Getting Started * Special Objects * Customization * Layouts * In Depth * Composition * Imports * Extensions * API * CLI manual * D2 Studio * Exports * Cheat Sheet * Frequently asked questions (FAQ) * Troubleshooting * Contributing Contents D2 Tour D2 is a diagram scripting language that turns text to diagrams. It stands for Declarative Diagramming. Declarative, as in, you describe what you want diagrammed, it generates the image. For example, download the CLI, create a file named input.d2, copy paste the following, run this command, and you get the image below. NETWORKUSERAPI SERVERLOGSCELL TOWERONLINE PORTALDATA PROCESSORSATELLITESTRANSMITTERUISTORAGE SENDSENDSENDPHONE LOGSMAKE CALL ACCESSDISPLAYPERSIST Using the CLI watch mode D2 CLI You can finish this tour in about 5-10 minutes, and at the end, there's a cheat sheet you can download and refer to. If you want just the bare essentials, Getting Started takes ~2 mins. info The source code for D2 is hosted here: https://github.com/terrastruct /d2. The source code for these docs are here: https://github.com/ terrastruct/d2-docs. info For each D2 snippet, you can hover over it to open directly in the Playground and tinker. There's some exceptions like snippets that use imports. Next Dev tool vs design tool Contents * Using the CLI watch mode D2 logo github logodiscord logo Created by Terrastruct logo|(c) 2025 Terrastruct, Inc. TourBlogExamplesReleases Playground