Windows
We have prebuilt [releases](https://github.com/terrastruct/d2/releases) of d2 available for Windows via `.msi` installers. The installer
will add the `d2` binary to your `$PATH` so that you can execute `d2` in `cmd.exe` or
`pwsh.exe`.
Release archives
We also have release archives for Windows structured in the same way as our Unix releases
for use with MSYS2.
<img width="1680" alt="Screenshot 2022-12-06 at 2 55 27 AM" src="https://user-images.githubusercontent.com/10180857/205892927-6f3e116c-1c4a-440a-9972-82c306aa9779.png">
See [MSYS2](https://www.msys2.org/) or [Git Bash](https://gitforwindows.org/#bash) (Git
Bash is based on MSYS2).
MSYS2 provides a unix style shell environment that is native to Windows (unlike
[Cygwin](https://www.cygwin.com/)). MSYS2 allows `install.sh` to work, enables automatic
installation of our standalone releases via `make install` and makes the manpage
accessible via `man d2`.
The MSYS2 terminal also enables `d2` to display colors like in the above screenshot.
In addition, all of our development and CI scripts work under MSYS2 whereas they do not
under plain Windows.
WSL
`d2` works perfectly under [WSL](https://learn.microsoft.com/en-us/windows/wsl/install)
aka Windows Subsystem for Linux if that's what you prefer. Installation is just like any
other Linux system.
Docker
https://hub.docker.com/repository/docker/terrastruct/d2
We publish `amd64` and `arm64` images based on `debian:latest` for each release.
Example usage:
sh
echo 'x -> y' >helloworld.d2
docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/home/debian/src" \
-p 127.0.0.1:8080:8080 terrastruct/d2:v0.1.2 --watch helloworld.d2