terraform workspace list
Theterraform workspace list command lists all existing workspaces.
Usage
Description
This command displays all available workspaces in your Terraform configuration. The currently selected workspace is marked with an asterisk (*).
The command reads workspace information from the backend configuration and does not write any state changes.
Example Output
development workspace is currently selected.
Options
This command accepts no command-specific options. Only global options are available.Workspace Override Behavior
If theTF_WORKSPACE environment variable is set, the command will display a note indicating that the active workspace is being overridden:
Exit Codes
0- Success1- Error (e.g., failed to load backend, failed to list workspaces)
Related Commands
- terraform workspace select - Switch to a different workspace
- terraform workspace new - Create a new workspace
- terraform workspace show - Show the current workspace name
- terraform workspace delete - Delete a workspace