Format Terraform files in current directory and subdirectories.
Section: Formatting and Validation
Format recursively
bash
bash
terraform fmt -recursiveExplanation
Format Terraform files in current directory and subdirectories.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Formatting and Validation
Validate configuration
Check whether configuration is syntactically valid and internally consistent.
Validate and return JSON
Emit machine-readable validation output, useful in CI.
Open Terraform console
Interactive REPL for testing expressions and inspecting values from state.
Run Terraform tests
Execute Terraform test files in the tests directory or specified test directory.
Show Terraform version
Print the installed Terraform CLI version and provider versions in use.