macOS
brew install d2local Homebrew formula metadata
sudo port install d2MacPorts ports tree · graphics/d2/Portfile · 来源: api.github.com
安装
brew install d2local Homebrew formula metadata
sudo port install d2MacPorts ports tree · graphics/d2/Portfile · 来源: api.github.com
sudo dnf install d2Fedora Rawhide package metadata · d2 · 来源: dl.fedoraproject.org
nix profile install nixpkgs#d2nixpkgs package indexes · pkgs/by-name/d2/d2/package.nix · 来源: api.github.com
sudo pacman -S d2Arch Linux sync databases · d2 · 来源: geo.mirror.pkgbuild.com
sudo zypper install d2openSUSE Tumbleweed package metadata · d2 · 来源: download.opensuse.org
scoop install main/d2Scoop official bucket manifest trees · bucket/d2.json · 来源: api.github.com
winget install --id Terrastruct.D2 -eWindows Package Manager source index · Terrastruct.D2 · 来源: cdn.winget.microsoft.com
概览
Modern diagram scripting language that turns text to diagrams
历史
D2 is a modern diagram scripting language and CLI that turns text files into diagrams, especially for software architecture and documentation workflows.
The D2 repository was created in 2022 by Terrastruct. The README presents D2 as a language, command-line renderer, and Go library, with official documentation, a playground, themes, language tooling, plugins, and export formats.
D2 entered the diagram-as-code ecosystem as another text-to-diagram option alongside tools such as Graphviz and Mermaid. Its README emphasizes package-manager installation, editor/tooling support, and a list of open-source projects that document with D2.
The usual workflow is to write a .d2 file and run the d2 CLI to produce SVG, PNG, or PDF output. D2 can also be used as a Go library and can swap layout engines such as ELK or TALA.
D2 is package-manager friendly because it ships as a single CLI for docs pipelines: install it with a system package manager, keep diagrams as source text, and regenerate images in builds or documentation sites.
安全态势
generalized runtime or code generation signal.
yellow 风险 · 中 置信度 · runtime
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
d2 | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
https://github.com/terrastruct/d2
安装元数据
| 软件包键 | brew:d2 |
|---|---|
| 版本 | 0.7.1 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/d2 |
| 主页 | https://d2lang.com/ |
| 仓库 | https://github.com/terrastruct/d2 |
| 上游文档 | https://d2lang.com/ |
| 许可证 | MPL-2.0 |
| 源码归档 | https://github.com/terrastruct/d2/archive/refs/tags/v0.7.1.tar.gz |
| 构建依赖 | go |
| Bottle | 可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | d2 |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
d2
nix profile install nixpkgs#d2d2 0.6.9-8.fc44
Modern diagram scripting language that turns text to diagrams
https://github.com/terrastruct/d2
sudo dnf install d2d2 0.7.1-2
A modern diagram scripting language that turns text to diagrams
sudo pacman -S d2d2 0.7.1-1.4
CLI tool and modern declarative language that turns text to diagrams
https://github.com/terrastruct/d2
sudo zypper install d2d2
sudo port install d2main/d2
scoop install main/d2Terrastruct.D2
winget install --id Terrastruct.D2 -e来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.