thothctl

Document IaC Command

Overview

The document iac command generates comprehensive documentation for Infrastructure as Code projects using terraform-docs and AI-powered documentation generation.

Usage

# 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

Features

Supported Frameworks

Output

The command generates:

Graph Formats

SVG (–graph-type dot):

Mermaid (–graph-type mermaid):

Examples

Generate Module Documentation

thothctl document iac -f terraform-terragrunt

Recursive Documentation

thothctl document iac -f terraform-terragrunt --recursive

Custom Configuration

thothctl document iac -f terraform --config-file custom-docs.yml

Generate Dependency Graphs

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

From Subdirectory

cd stacks/app
thothctl document iac -f terragrunt --graph-type mermaid

Shows current module and its dependencies with relative paths