Skip to content

Quickstart

GitHub →

Install

Homebrew (macOS and Linux, recommended)

brew install --cask madstone-tech/tap/ayida
ayida --version

From Go

go install github.com/madstone-tech/ayida/v2@latest     # needs Go 1.27 or later

Docker

Run the image without installing anything:

docker run --rm -v "$PWD:/workspace" ghcr.io/madstone-tech/ayida:latest validate

Release 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.

Coming from loko? Follow Upgrading from loko.

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 notes

Exit codes are 0 clean, 1 errors, 2 warnings under --strict. There are exactly three, so a CI pipeline can branch on them.

Common commands

CommandDescription
ayida validateCompile and report diagnostics
ayida fmtCanonical formatting (--check for CI)
ayida queryDependents, dependencies, paths, orphans, coupling, flows and listings
ayida exportCompiled architecture as JSON or TOON
ayida diffSemantic diff between two revisions, with blast radius
ayida changelogThe diff as markdown release notes
ayida buildRender diagrams, markdown and a site into dist/
ayida build --format mdMarkdown only (adds the SVG it embeds)
ayida servePreview server with live reload
ayida mcpStart 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.