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

TFLint

$ tflint Community Low Risk
Terraform Linters · Cloud & Infra · MPL-2.0 · macos / linux / windows

tflint goes beyond terraform validate by linting HCL against cloud provider-specific rulesets (AWS, Azure, GCP) and Terraform naming/type conventions. It runs non-interactively, supports --recursive multi-module scans, and emits clean JSON diagnostics via --format json.

FCRS-1.0 Score
91 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install tflint
CLI vs MCP Decision CLI Only

Local HCL static linter with --format json; direct CLI execution beats MCP indirection.

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

Supports --format json, --format sarif, --format compact, --no-color, and --recursive with clear exit codes.

  • Native --format json and --no-color flags
  • Headless --recursive directory traversal
Trust & Safety 24 / 25

Read-only static analysis by default; local writes occur only for --init plugin caching or explicit --fix.

  • Zero cloud credentials required; read-only default mode
Setup & Portability 14 / 15

Single static Go binary for macOS, Linux, and Windows via Homebrew, Chocolatey, Docker, and GitHub Releases.

  • Single static Go binary with cross-platform packages
Utility & Efficiency 14 / 15

Catches invalid instance types, deprecated syntax, and unused declarations before terraform plan.

  • Pluggable AWS/Azure/GCP rulesets catch provider-level errors offline
Maintenance & Lineage 8 / 10

Widely adopted community-maintained tool (terraform-linters/tflint) under MPL-2.0.

  • Active terraform-linters/tflint repo under MPL-2.0
Docs & Verifiability 9 / 10

Well-documented user guide, rule catalog, and .tflint.hcl configuration reference.

  • Detailed user guide and rule docs in repository

Security, Auth & Guardrails

Auth Modes
No Auth Env API Key
Credential Storage

Core linting requires no auth; tflint --init honors GITHUB_TOKEN to avoid rate limits when downloading provider plugins.

Side Effects
Read-Only Local Write
Cost & Quotas

MPL-2.0 open-source and free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# TFLint Agent Rules
- Always pass `--format json` or `--format compact --no-color`.
- Run `tflint --init` once if `.tflint.hcl` declares external plugins.
- Do not pass `--fix` without reviewing `git diff` afterward.

Agent-Ready Command Recipes

Safe Read-Only Queries

Lint Terraform modules recursively as JSON
tflint --recursive --format json

Scans the root and all child directories, emitting structured JSON issues and errors.

Run lint with --fix disabled and no color
tflint --no-color --format compact

Outputs concise file:line:col: message lines when minimal token output is preferred.

Controlled Writes & Previews

Initialize configured TFLint plugins
tflint --init

Downloads plugins declared in .tflint.hcl into the local ~/.tflint.d/plugins cache.

Strengths for Agents

  • + Clean --format json and --format compact outputs with --no-color.
  • + Catches provider-specific errors (like invalid EC2 types) locally before plan.
  • + Supports --recursive scanning across monorepos.

Caveats & Pitfalls

  • ! Provider-specific checks require running tflint --init with network access first.
  • ! Complex dynamic HCL expressions can sometimes trigger false positives without config tuning.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI