github.com/hugorut/terraform@v1.1.3/website/docs/cli/code/index.mdx (about) 1 --- 2 page_title: Writing and Modifying Code - Terraform CLI 3 description: >- 4 Learn commands that help validate, format, and upgrade code written in the 5 Terraform Configuration Language. 6 --- 7 8 # Writing and Modifying Terraform Code 9 10 The [Terraform language](/language) is Terraform's primary 11 user interface, and all of Terraform's workflows rely on configurations written 12 in the Terraform language. 13 14 Terraform CLI includes several commands to make Terraform code more convenient 15 to work with. Integrating these commands into your editing workflow can 16 potentially save you time and effort. 17 18 - [The `terraform console` command](/cli/commands/console) starts an 19 interactive shell for evaluating Terraform 20 [expressions](/language/expressions), which can be a faster way 21 to verify that a particular resource argument results in the value you expect. 22 23 - [The `terraform fmt` command](/cli/commands/fmt) rewrites Terraform 24 configuration files to a canonical format and style, so you don't have to 25 waste time making minor adjustments for readability and consistency. It works 26 well as a pre-commit hook in your version control system. 27 28 - [The `terraform validate` command](/cli/commands/validate) validates the 29 syntax and arguments of the Terraform configuration files in a directory, 30 including argument and attribute names and types for resources and modules. 31 The `plan` and `apply` commands automatically validate a configuration before 32 performing any other work, so `validate` isn't a crucial part of the core 33 workflow, but it can be very useful as a pre-commit hook or as part of a 34 continuous integration pipeline. 35 36 - [The `0.13upgrade` command](/cli/commands/0.13upgrade) and 37 [the `0.12upgrade` command](/cli/commands/0.12upgrade) can automatically 38 modify the configuration files in a Terraform module to help deal with major 39 syntax changes that occurred in the 0.13 and 0.12 releases of Terraform. Both 40 of these commands are only available in the Terraform version they are 41 associated with, and you are expected to upgrade older code to be compatible 42 with 0.12 before attempting to make it compatible with 0.13. For more detailed 43 information about updating code for new Terraform versions, see the [upgrade 44 guides](/language/upgrade-guides) in the Terraform language docs.