Quickstart
Install
Homebrew (macOS and Linux, recommended)
brew install --cask madstone-tech/tap/ayida
ayida --versionFrom Go
go install github.com/madstone-tech/ayida/v2@latest # needs Go 1.27 or laterDocker
Run the image without installing anything:
docker run --rm -v "$PWD:/workspace" ghcr.io/madstone-tech/ayida:latest validateRelease archives for Linux, macOS and Windows are on the releases page.
Nothing else is needed for rendering: diagrams render inside ayida, so there is no d2 binary to
install.
Write an architecture
Create arch.ayida.hcl:
project "acme-payments" {
description = "Payment processing platform"
ayida_version = "~> 2.0"
}
person "customer" {
description = "Pays for orders"
uses "checkout" {
target = container.api
description = "Pays with a card"
technology = "HTTPS"
}
}
system "payments" {
description = "Authorization, capture, settlement"
owner = "platform-team"
}
container "api" {
system = system.payments
title = "Payments API"
technology = "AWS Lambda (Go)"
shape = "function"
uses "orders" {
target = container.orders_db
description = "Reads and writes orders"
}
uses "settle" {
target = container.settlements
description = "Queues captured payments"
kind = "async"
}
}
container "orders_db" {
system = system.payments
technology = "Aurora PostgreSQL"
shape = "database"
}
container "settlements" {
system = system.payments
technology = "Amazon SQS"
shape = "queue"
}Every *.ayida.hcl file beneath the directory is part of the architecture.
Check it, draw it, ask it
ayida validate # errors and warnings, with positions
ayida build # diagrams, markdown and a site in ./dist
ayida serve # preview at http://localhost:8080, live reload
ayida query dependents container.orders_db # who breaks if the database is down?
ayida query path person.customer container.orders_db # how a request reaches it
ayida query elements --kind container # list every container
ayida export --format json # the compiled model, for programs and CI
ayida diff main # what changed since main, and what it affects
ayida changelog v2.0.0..v2.1.0 # the changes as markdown, for release notesExit codes are 0 clean, 1 errors, 2 warnings under --strict. There are exactly three, so a
CI pipeline can branch on them.
Common commands
| Command | Description |
|---|---|
ayida validate | Compile and report diagnostics |
ayida fmt | Canonical formatting (--check for CI) |
ayida query | Dependents, dependencies, paths, orphans, coupling, flows and listings |
ayida export | Compiled architecture as JSON or TOON |
ayida diff | Semantic diff between two revisions, with blast radius |
ayida changelog | The diff as markdown release notes |
ayida build | Render diagrams, markdown and a site into dist/ |
ayida build --format md | Markdown only (adds the SVG it embeds) |
ayida serve | Preview server with live reload |
ayida mcp | Start the MCP server |
Use ayida --help for general help, and ayida <command> --help for one command. The full
reference is on the CLI reference page.
See a finished site
Before you build your own, look at the live example. It is the
microservices sample project from the ayida repository, compiled with ayida build and hosted at
docs.mdstn.dev/ayida/demo. Locally, ayida build && ayida serve gives you the
same output.