Tired of typing terraform workspace select <long-workspace-name>? tfws runs terraform workspace list, lets you pick with arrow keys, and switches instantly.
Run tfws in any directory with an initialized Terraform project:
$ tfws
default
> staging
production
↑/↓ork/j— move selectionEnter— switch to workspaceEsc/q— cancel
The current workspace is pre-selected.
cargo install tfwstfws writes the selected workspace name to .terraform/environment, which is the same file Terraform uses internally when you run terraform workspace select. No Terraform state is modified.
- Terraform must be installed and on your
$PATH - Must be run from a directory where
terraform inithas been run