Skip to content
Back to skills

D2 Diagram Scripting Language Cli

ASecurity

D2 is a modern diagram scripting language that turns text into diagrams. It compiles declarative text files into SVG, PNG, and PDF outputs with automatic layout, multiple themes, and support for sequence diagrams, class diagrams, and network topologies.

  • 36 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 8, 2026
ai-agentspythongonodegitsecurity

Works with

  • cli

Security analysis

A100/100

Scanned June 8, 2026

npx -y skills add agentskillexchange/skills --skill d2-diagram-scripting-language-cli --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of D2 Diagram Scripting Language Cli?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for D2 Diagram Scripting Language Cli
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/agentskillexchange-d2-diagram-scripting-language-cli/badge)](https://www.skillsdirectory.com/skills/agentskillexchange-d2-diagram-scripting-language-cli)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "D2 Modern Diagram Scripting Language and CLI"
slug: "d2-diagram-scripting-language-cli"
description: "D2 is a modern diagram scripting language that turns text into diagrams. It compiles declarative text files into SVG, PNG, and PDF outputs with automatic layout, multiple themes, and support for sequence diagrams, class diagrams, and network topologies."
github_stars: 23316
verification: "security_reviewed"
source: "https://github.com/terrastruct/d2"
category: "Developer Tools"
framework: "Multi-Framework"
tool_ecosystem:
  github_repo: "terrastruct/d2"
  github_stars: 23316
  npm_package: "@terrastruct/d2"
  npm_weekly_downloads: 14050
---

# D2 Modern Diagram Scripting Language and CLI

D2 is a modern diagram scripting language that turns text into diagrams. It compiles declarative text files into SVG, PNG, and PDF outputs with automatic layout, multiple themes, and support for sequence diagrams, class diagrams, and network topologies.

## Installation

Use the upstream install or setup path that matches your environment:
- go install oss.terrastruct.com/d2@latest

Requirements and caveats from upstream:
- particularly suited for node-link diagrams with an inherent direction and ports.
- specifically for software architecture diagrams. Requires separate install, visit the
- **Python D2 diagram builder**: [https://github.com/MrBlenny/py-d2](https://github.com/MrBlenny/py-d2)

Basic usage or getting-started notes:
- <img width="400px" src="./docs/assets/example.svg" alt="D2 render example" />
- The most convenient way to use D2 is to just run it as a CLI executable to
- produce SVGs from .d2 files.

- Source: https://github.com/terrastruct/d2
- Extracted from upstream docs: https://raw.githubusercontent.com/terrastruct/d2/HEAD/README.md

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/d2-diagram-scripting-language-cli/)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.