25 lines
706 B
Markdown
25 lines
706 B
Markdown
![]() |
---
|
||
|
layout: "docs"
|
||
|
page_title: "Command: fmt"
|
||
|
sidebar_current: "docs-commands-fmt"
|
||
|
description: |-
|
||
|
The `terraform fmt` command is used to rewrite Terraform configuration files to a canonical format and style.
|
||
|
---
|
||
|
|
||
|
# Command: fmt
|
||
|
|
||
|
The `terraform fmt` command is used to rewrite Terraform configuration files
|
||
|
to a canonical format and style.
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
Usage: `terraform fmt [options] [DIR]`
|
||
|
|
||
|
`fmt` scans the current directory for configuration files.
|
||
|
|
||
|
The command-line flags are all optional. The list of available flags are:
|
||
|
|
||
|
* `-list=false` - List files whose formatting differs
|
||
|
* `-write=false` - Write result to source file instead of STDOUT
|
||
|
* `-diff=false` - Display diffs instead of rewriting files
|