github.com/Kevinklinger/open_terraform@v0.11.12-beta1/website/docs/commands/fmt.html.markdown (about) 1 --- 2 layout: "docs" 3 page_title: "Command: fmt" 4 sidebar_current: "docs-commands-fmt" 5 description: |- 6 The `terraform fmt` command is used to rewrite Terraform configuration files to a canonical format and style. 7 --- 8 9 # Command: fmt 10 11 The `terraform fmt` command is used to rewrite Terraform configuration files 12 to a canonical format and style. 13 14 ## Usage 15 16 Usage: `terraform fmt [options] [DIR]` 17 18 By default, `fmt` scans the current directory for configuration files. If 19 the `dir` argument is provided then it will scan that given directory 20 instead. If `dir` is a single dash (`-`) then `fmt` will read from standard 21 input (STDIN). 22 23 The command-line flags are all optional. The list of available flags are: 24 25 * `-list=true` - List files whose formatting differs (disabled if using STDIN) 26 * `-write=true` - Write result to source file instead of STDOUT (disabled if 27 using STDIN or -check) 28 * `-diff=false` - Display diffs of formatting changes 29 * `-check=false` - Check if the input is formatted. Exit status will be 0 if 30 all input is properly formatted and non-zero otherwise.