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
| Flag | Purpose |
|---|---|
| -o, --output | Output file name |
| --drawio | Generate draw.io instead of PNG |
| -f, --force | Overwrite output without confirmation |
| --width / --height | Resize PNG output |
| -t, --template | Render the input as Go text/template |
| -c, --cfn-template | Create diagram from CloudFormation |
| -d, --dac-file | Generate DAC YAML from CloudFormation |
| --allow-untrusted-definitions | Allow non-official definition sources |
| -v, --verbose | Verbose 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.