terraform workspace list command
The terraform workspace list command lists all existing workspaces.
Usage
Usage: terraform workspace list [options]
The command will list all existing workspaces. The current workspace is
indicated using an asterisk (*) marker.
The command-line flags are all optional. The following flags are available:
-json- Produce output in a machine-readable JSON format, suitable for use in text editor integrations and other automated systems. Always disables color.-no-color- If specified, output won't contain any color. Currently, this is only relevant to diagnostics returned from this command.
Example
$ terraform workspace list
default
* development
jsmith-test
$ terraform workspace list -json
{
"format_version": "1.0",
"workspaces": [
{
"name": "default",
"is_current": false
},
{
"name": "development",
"is_current": true
},
{
"name": "jsmith-test",
"is_current": false
}
],
"diagnostics": []
}