github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/commands/index.html.markdown (about) 1 --- 2 layout: "docs" 3 page_title: "Commands" 4 sidebar_current: "docs-commands" 5 description: |- 6 Terraform is controlled via a very easy to use command-line interface (CLI). Terraform is only a single command-line application: terraform. This application then takes a subcommand such as "apply" or "plan". The complete list of subcommands is in the navigation to the left. 7 --- 8 9 # Terraform Commands (CLI) 10 11 Terraform is controlled via a very easy to use command-line interface (CLI). 12 Terraform is only a single command-line application: terraform. This application 13 then takes a subcommand such as "apply" or "plan". The complete list of subcommands 14 is in the navigation to the left. 15 16 The terraform CLI is a well-behaved command line application. In erroneous cases, 17 a non-zero exit status will be returned. It also responds to -h and --help as you'd 18 most likely expect. 19 20 To view a list of the available commands at any time, just run terraform with no arguments: 21 22 ``` 23 $ terraform 24 Usage: terraform [--version] [--help] <command> [args] 25 26 The available commands for execution are listed below. 27 The most common, useful commands are shown first, followed by 28 less common or more advanced commands. If you're just getting 29 started with Terraform, stick with the common commands. For the 30 other commands, please read the help and docs before usage. 31 32 Common commands: 33 apply Builds or changes infrastructure 34 console Interactive console for Terraform interpolations 35 destroy Destroy Terraform-managed infrastructure 36 fmt Rewrites config files to canonical format 37 force-unlock Manually unlock the terraform state 38 get Download and install modules for the configuration 39 graph Create a visual graph of Terraform resources 40 import Import existing infrastructure into Terraform 41 init Initialize a new or existing Terraform configuration 42 output Read an output from a state file 43 plan Generate and show an execution plan 44 push Upload this Terraform module to Atlas to run 45 refresh Update local state file against real resources 46 show Inspect Terraform state or plan 47 taint Manually mark a resource for recreation 48 untaint Manually unmark a resource as tainted 49 validate Validates the Terraform files 50 version Prints the Terraform version 51 52 All other commands: 53 debug Debug output management (experimental) 54 state Advanced state management 55 ``` 56 57 To get help for any specific command, pass the -h flag to the relevant subcommand. For example, 58 to see help about the graph subcommand: 59 60 ``` 61 $ terraform graph -h 62 Usage: terraform graph [options] PATH 63 64 Outputs the visual graph of Terraform resources. If the path given is 65 the path to a configuration, the dependency graph of the resources are 66 shown. If the path is a plan file, then the dependency graph of the 67 plan itself is shown. 68 69 The graph is outputted in DOT format. The typical program that can 70 read this format is GraphViz, but many web services are also available 71 to read this format. 72 ```