|
| 1 | +--- |
| 2 | +layout: "docs" |
| 3 | +page_title: "Command: version" |
| 4 | +sidebar_current: "docs-commands-version" |
| 5 | +description: |- |
| 6 | + The `terraform version` command displays the version of Terraform and all installed plugins. |
| 7 | +--- |
| 8 | + |
| 9 | +# Command: version |
| 10 | + |
| 11 | +The `terraform version` displays the current version of Terraform and all |
| 12 | +installed plugins. |
| 13 | + |
| 14 | +## Usage |
| 15 | + |
| 16 | +Usage: `terraform version [options]` |
| 17 | + |
| 18 | +With no additional arguments, `version` will display the version of Terraform, |
| 19 | +the platform it's installed on, installed providers, and the results of upgrade |
| 20 | +and security checks [unless disabled](/docs/commands/index.html#upgrade-and-security-bulletin-checks). |
| 21 | + |
| 22 | +This command has one optional flag: |
| 23 | + |
| 24 | +* `-json` - If specified, the version information is formatted as a JSON object, |
| 25 | + and no upgrade or security information is included. |
| 26 | + |
| 27 | +-> **Note:** Platform information was added to the `version` command in Terraform 0.15. |
| 28 | + |
| 29 | +## Example |
| 30 | + |
| 31 | +Basic usage, with upgrade and security information shown if relevant: |
| 32 | + |
| 33 | +```shellsession |
| 34 | +$ terraform version |
| 35 | +Terraform v0.15.0 |
| 36 | +on darwin_amd64 |
| 37 | ++ provider registry.terraform.io/hashicorp/null v3.0.0 |
| 38 | + |
| 39 | +Your version of Terraform is out of date! The latest version |
| 40 | +is X.Y.Z. You can update by downloading from https://www.terraform.io/downloads.html |
| 41 | +``` |
| 42 | + |
| 43 | +As JSON: |
| 44 | + |
| 45 | +```shellsession |
| 46 | +$ terraform version -json |
| 47 | +{ |
| 48 | + "terraform_version": "0.15.0", |
| 49 | + "platform": "darwin_amd64", |
| 50 | + "provider_selections": { |
| 51 | + "registry.terraform.io/hashicorp/null": "3.0.0" |
| 52 | + }, |
| 53 | + "terraform_outdated": true |
| 54 | +} |
| 55 | +``` |
0 commit comments