Installation
Building from source
To build this repo from the sources (you’ll need git
and Java 17+ installed):
git clone https://github.com/structurizr/cli.git structurizr-cli
cd structurizr-cli
./gradlew
If successful, The build/distributions
directory will contain a .zip
file, with which you can:
- Unzip into a directory of your choice.
- Add the directory to your operating system’s path (optional).
- Use the
structurizr.sh
orstructurizr.bat
file as appropriate for your operating system.
Local installation
- Download the Structurizr CLI from https://github.com/structurizr/cli/releases, and unzip. You will need Java (version 17+) installed, and available to use from your command line.
- Unzip into a directory of your choice.
- Add the directory to your operating system’s path (optional).
- Use the
structurizr.sh
orstructurizr.bat
file as appropriate for your operating system.
Docker
A prebuilt Docker image is available at Docker Hub. To use it, for example:
docker pull structurizr/cli:latest
docker run -it --rm -v $PWD:/usr/local/structurizr structurizr/cli <parameters>
In this example, $PWD
will mount the current local directory as the CLI working directory (/usr/local/structurizr
in the Docker container).
Alternative images are available via:
- aidmax/structurizr-cli-docker (GitHub Actions compatible)
- sebastienfi/structurizr-cli-with-bonus (GitHub Actions compatible; includes PlantUML)
Package managers
Homebrew (MacOS only)
The Structurizr CLI can be installed via Homebrew as follows:
brew install structurizr-cli
And to upgrade:
brew update
brew upgrade structurizr-cli
Scoop (Windows only)
The Structurizr CLI can be installed via Scoop as follows:
scoop bucket add extras
scoop install structurizr-cli
And to upgrade:
scoop update structurizr-cli
GitHub Actions
Some pre-built GitHub Actions are available on the GitHub Actions marketplace.
GitLab
To export your diagrams to Mermaid format in gitlab-ci, add the workspace.dsl
to your repo and add this job to your .gitlab-ci.yml
:
job_name:
stage: stage_name
image:
name: structurizr/cli
entrypoint: [""]
script:
- /usr/local/structurizr-cli/structurizr.sh export --workspace workspace.dsl --format mermaid
artifacts:
paths:
- "*.mmd"
Gradle
A pre-built Gradle plugin is available from jakzal/gradle-structurizr-cli.