![Forrest logo](/images/logo.png)
terraform-fmt:tldr:71a93
terraform-fmt: Format the configuration in the current directory.
$ terraform fmt
try on your machine
The terraform fmt
command is used to reformat the Terraform configuration files to adhere to a consistent style and format.
When you run terraform fmt
, it scans the current directory for any Terraform configuration files with the .tf
extension and automatically rewrites them to a standard format.
This command helps enforce a consistent style across all Terraform configuration files, making it easier for multiple team members to collaborate, understand, and maintain the codebase. It also ensures that the code is well-formatted, which can improve readability and reduce the chance of syntax errors.
This explanation was created by an AI. In most cases those are correct. But please always be careful and
never run a command you are not sure if it is safe.