Back to Home
Documentation

Reference

CLI Reference

Installation, commands, flags, and usage scenarios for the awsdac command line interface.

The CLI is the best fit when diagrams should live with infrastructure code, run in CI/CD, or be generated in automation pipelines.

Install

bash
# macOS
brew install awsdac

# Go install
go install github.com/fernandofatech/diagram-as-code/cmd/awsdac@latest

Basic usage

bash
# Generate PNG
awsdac examples/alb-ec2.yaml

# Custom output file
awsdac examples/alb-ec2.yaml -o my-diagram.png

# Generate draw.io XML
awsdac examples/alb-ec2.yaml --drawio -o output.drawio

# Output extension also selects format
awsdac examples/alb-ec2.yaml -o output.drawio

Main flags

FlagPurpose
-o, --outputOutput file name
--drawioGenerate draw.io instead of PNG
-f, --forceOverwrite output without confirmation
--width / --heightResize PNG output
-t, --templateRender the input as Go text/template
-c, --cfn-templateCreate diagram from CloudFormation
-d, --dac-fileGenerate DAC YAML from CloudFormation
--allow-untrusted-definitionsAllow non-official definition sources
-v, --verboseVerbose logging

CLI scenarios

  • Local engineering documentation stored next to IaC.
  • CI/CD generation of diagrams for pull requests or release artifacts.
  • Batch rendering multiple YAML files as part of docs automation.