Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

terraform-docs

$ terraform-docs Official Low Risk
terraform-docs · Cloud & Infra · MIT · macos / linux / windows

terraform-docs parses Terraform and OpenTofu HCL modules locally and emits Markdown tables, JSON ASTs, YAML, or tfvars without needing provider credentials. Agents can inspect module inputs, outputs, and dependencies as structured JSON or update README.md deterministically.

FCRS-1.0 Score
92 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install terraform-docs
CLI vs MCP Decision CLI Only

Pure local HCL AST parser; terraform-docs json . runs in milliseconds with zero MCP server overhead.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 22 / 25

First-class json subcommand outputs clean structured metadata, never prompts on TTY, and returns predictable exit codes including --output-check drift detection.

  • Native terraform-docs json <path> structured output
  • Non-interactive execution and --output-check CI verification
Trust & Safety 24 / 25

Requires zero cloud credentials or network calls and defaults to stdout unless --output-file is explicitly passed.

  • Zero auth required and read-only stdout default
  • Delimited --output-mode inject limits file edits
Setup & Portability 15 / 15

Single static Go binary distributed via Homebrew, Docker, Go install, and release archives across macOS, Linux, and Windows.

  • Zero runtime dependencies; single static Go binary
Utility & Efficiency 13 / 15

Eliminates manual HCL parsing and keeps module documentation synced with minimal context tokens.

  • Supports .terraform-docs.yml config and JSON/YAML/Markdown formatters
Maintenance & Lineage 9 / 10

Official terraform-docs project under MIT license with broad community adoption.

  • Maintained at terraform-docs/terraform-docs under MIT
Docs & Verifiability 9 / 10

Well-structured documentation site with clear formatter references and config examples.

  • Dedicated user guide and formatter docs at terraform-docs.io

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

No authentication or cloud credentials required; operates purely on local HCL module files.

Side Effects
Read-Only Local Write
Cost & Quotas

MIT open-source and completely free; runs 100% locally.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# terraform-docs Agent Rules
- Prefer `terraform-docs json .` when inspecting module variables and outputs.
- Preview stdout before passing `--output-file README.md`.
- Use `--output-check` in CI to detect drift without mutating files.

Agent-Ready Command Recipes

Safe Read-Only Queries

Extract module schema as JSON
terraform-docs json .

Outputs inputs, outputs, providers, and module calls as structured JSON without modifying files.

Preview Markdown table to stdout
terraform-docs markdown table .

Renders the module documentation table to stdout for inspection before writing to disk.

Controlled Writes & Previews

Inject docs into README with check mode
terraform-docs markdown table --output-file README.md --output-mode inject .

Updates only the delimited BEGIN_TF_DOCS section in README.md via --output-mode inject.

Strengths for Agents

  • + Outputs complete module inputs, outputs, and resources via terraform-docs json ..
  • + Runs completely offline with zero cloud credentials or Terraform state access.
  • + Supports --output-check to verify doc freshness without modifying files.

Caveats & Pitfalls

  • ! Passing --output-file without --output-mode inject overwrites the target file.
  • ! No --json global flag syntax; JSON is selected as the json subcommand.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI