The document iac command generates comprehensive documentation for Infrastructure as Code projects using terraform-docs and AI-powered documentation generation.
# Basic documentation generation
thothctl document iac -f terraform-terragrunt
# Recursive documentation
thothctl document iac -f terraform-terragrunt --recursive
# Custom configuration
thothctl document iac -f terraform --config-file .terraform-docs.yml
The command generates:
SVG (–graph-type dot):
Mermaid (–graph-type mermaid):
thothctl document iac -f terraform-terragrunt
thothctl document iac -f terraform-terragrunt --recursive
thothctl document iac -f terraform --config-file custom-docs.yml
SVG Graph (Default):
thothctl document iac -f terragrunt --graph-type dot
Output: graph.svg with visual dependency tree
Mermaid Graph:
thothctl document iac -f terragrunt --graph-type mermaid
Output: graph.mmd with text-based diagram showing:
Example Mermaid Output:
graph LR
vpc["<b>vpc</b>"]:::rootNode
app["<b>app</b><br/><small>📥 vpc: vpc_id, subnet_ids</small>"]:::normalNode
app -->|vpc_id, subnet_ids| vpc
cd stacks/app
thothctl document iac -f terragrunt --graph-type mermaid
Shows current module and its dependencies with relative paths
check iac - Validate structureinventory iac - Create inventoryscan iac - Security scanning