The thothctl inventory command group provides tools for creating, managing, and updating inventories of your infrastructure components. These inventories help you track modules, their versions, sources, and dependencies, providing valuable insights into your infrastructure composition with modern, professional reporting and comprehensive analysis.
--check-versions flag handles both module and provider version checkingCreates a comprehensive inventory of Infrastructure as Code (IaC) components in your project.
# Recommended: Comprehensive analysis with modern reporting
thothctl inventory iac --check-versions
# Basic inventory with modern HTML report
thothctl inventory iac
# Complete analysis with all report types
thothctl inventory iac --check-versions --report-type all
Key Features:
-cv, --check-versions: π Recommended - Checks latest versions for modules and providers (includes provider version checking)-r, --report-type [html|json|all]: Type of report to generate (default: html with modern styling)-pj, --project-name TEXT: Custom project name for professional reports-iph, --inventory-path PATH: Where to save inventory reports (default: ./Reports)-ft, --framework-type [auto|terraform|terragrunt|terraform-terragrunt]: Framework type to analyze (auto-detection recommended)--check-providers: Check provider information (automatically enabled with --check-versions)--provider-tool [tofu|terraform]: Tool for provider analysis (default: tofu)--complete: Include .terraform and .terragrunt-cache folders-iact, --inventory-action [create|update|restore]: Action to perform (default: create)--auto-approve: Auto-approve updates without confirmation--update-dependencies-path: Path to inventory JSON for updatesthothctl inventory iac --framework-type auto --check-versions
Automatically detects the framework type and provides comprehensive analysis.
thothctl inventory iac --framework-type terraform --check-versions
Analyzes Terraform files (.tf) with modern reporting and version checking.
thothctl inventory iac --framework-type terragrunt --check-versions
Analyzes Terragrunt files (terragrunt.hcl) with provider version analysis.
thothctl inventory iac --framework-type terraform-terragrunt --check-versions
Analyzes both Terraform and Terragrunt files with comprehensive reporting.
thothctl inventory iac --check-versions --report-type html
Features:
thothctl inventory iac --check-versions --report-type json
Features:
thothctl inventory iac --check-versions --report-type all
Generates both modern HTML and JSON reports for comprehensive documentation and automation.
thothctl inventory iac --check-versions
What it does:
thothctl inventory iac \
--check-versions \
--report-type all \
--project-name "Production Infrastructure" \
--inventory-path ./docs/infrastructure
What it does:
thothctl inventory iac \
--check-versions \
--report-type json \
--inventory-path ./reports/$(date +%Y-%m-%d)
What it does:
thothctl inventory iac --check-versions --report-type all
Benefits:
thothctl inventory iac \
--check-versions \
--project-name "Infrastructure Documentation" \
--report-type html
Benefits:
thothctl inventory iac --check-versions --report-type json
Benefits:
thothctl inventory iac \
--check-versions \
--complete \
--report-type all
Benefits:
# Weekly infrastructure health check
thothctl inventory iac --check-versions
# Generate business-ready reports
thothctl inventory iac \
--check-versions \
--project-name "$(basename $(pwd)) Infrastructure - $(date +%B\ %Y)" \
--report-type html
# CI/CD pipeline integration
thothctl inventory iac \
--check-versions \
--report-type json \
--inventory-path ./reports/$(date +%Y-%m-%d)
# Monthly comprehensive audit
thothctl inventory iac \
--check-versions \
--complete \
--report-type all \
--project-name "Monthly Infrastructure Audit"
# Old approach with redundant flags
thothctl inventory iac --check-providers --check-provider-versions --check-versions
# New simplified approach
thothctl inventory iac --check-versions
Benefits:
# Use OpenTofu (recommended for modern workflows)
thothctl inventory iac --check-versions --provider-tool tofu
# Use Terraform (for legacy workflows)
thothctl inventory iac --check-versions --provider-tool terraform
# Include normally excluded directories
thothctl inventory iac --check-versions --complete
# Organized by environment and date
thothctl inventory iac \
--check-versions \
--inventory-path ./reports/production/$(date +%Y-%m) \
--project-name "Production Infrastructure - $(date +%B\ %Y)"
Starting with v0.25.0, thothctl inventory iac --check-versions supports AWS CDK projects (TypeScript and Python). CDK projects are auto-detected when a cdk.json file is present in the project root.
| Language | Parsed Files | Registry |
|---|---|---|
| TypeScript | package.json + package-lock.json |
npm registry |
| Python | requirements.txt / pyproject.toml |
PyPI |
ThothCTL identifies CDK construct libraries (e.g., aws-cdk-lib, cdk-nag, @aws-cdk/aws-lambda-python-alpha) and checks the upstream registry for the latest published version and release date.
# In a CDK project directory (cdk.json present)
thothctl inventory iac --check-versions
π¦ CDK Construct Inventory β my-cdk-app
Package Current Latest Status Released
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
aws-cdk-lib 2.140.0 2.155.0 Outdated 2026-07-15
cdk-nag 2.28.0 2.34.1 Outdated 2026-06-20
constructs 10.3.0 10.3.0 Current 2026-05-01
@aws-cdk/aws-lambda-python-alpha 2.140.0-alpha.0 2.155.0-alpha.0 Outdated 2026-07-15
@myorg/cdk-patterns 1.5.0 β Internal β
β
3 outdated Β· 1 current Β· 1 internal (skipped)
Packages with internal or organization scopes (e.g., @myorg/cdk-patterns) are detected and listed in the inventory but are not version-checked against a public registry. They appear with status Internal.
For every package checked against npm or PyPI, the release date of the latest version is fetched and displayed. This helps teams assess how far behind they are in calendar time, not just version numbers.
CDK inventory data flows into the same report pipeline:
pkg:npm/ or pkg:pypi/ PURL schemeStarting with v0.19.0, a CycloneDX 1.6 SBOM is always generated alongside HTML and JSON reports. This provides a standardized Software Bill of Materials for your infrastructure components.
# SBOM is automatically generated with every inventory run
thothctl inventory iac --check-versions
CycloneDX SBOM includes:
| Section | Content |
|---|---|
| Formulation | IaC toolchain (Terraform/OpenTofu version, provider versions) |
| Lifecycles | Build and deploy lifecycle phases |
| Evidence | Source-code-analysis proof of component usage |
| Standards | Organizational IaC policies (org-iac-policies) |
| Attestations | Tech debt indicators and version currency |
| Dependencies | Full DAG (Directed Acyclic Graph) of module relationships |
| Hashes | SHA-256 integrity verification for all components |
| Licenses | Inferred license information (MPL-2.0, Apache-2.0) |
Package URL format: All components use the pkg:terraform/ PURL scheme for standard identification.
Compatible SBOM consumers:
Reports are now organized under Reports/inventory/ for cleaner project structure:
Reports/
βββ inventory/
βββ html_reports/
β βββ InventoryIaC_<project>_<date>.html
βββ InventoryIaC_<project>_<date>.json
βββ InventoryIaC_cyclonedx_<project>_<date>.json
| Report Type | Path |
|---|---|
| HTML | Reports/inventory/html_reports/ |
| JSON | Reports/inventory/InventoryIaC_*.json |
| CycloneDX SBOM | Reports/inventory/InventoryIaC_cyclonedx_*.json |
Migration note: Reports previously written to
Reports/root are now placed inReports/inventory/. The--inventory-pathdefault is./Reports.
The inventory integrates with the ThothCTL web dashboard for interactive exploration:
# Launch the dashboard
thothctl dashboard launch
Inventory Tab:
SBOM Details Tab:
# Generate inventory then explore in dashboard
thothctl inventory iac --check-versions
thothctl dashboard launch
# Detailed command help
thothctl inventory iac --help
# Debug mode for troubleshooting
thothctl --debug inventory iac --check-versions
The ThothCTL inventory commands now provide:
--check-versions flag for comprehensive analysisRecommended command for most users:
thothctl inventory iac --check-versions
This provides comprehensive analysis with modern reporting in a single, simple command.