The Terraform Workspace Selector is a command-line tool that helps you interactively select a Terraform workspace from the available options.
The application provides the following basic functionality:
- Retrieves the list of Terraform workspaces using the
terraform workspace listcommand. - Displays an interactive prompt that allows you to select a workspace.
- Sets the selected workspace using the
terraform workspace selectcommand.
tfws calls terraform directly, so terraform will need to be resolvable from your PATH. Tools like tenv or asdf should natively work.
The Terraform Workspace Selector can be installed on macOS, Linux, or Windows, and should work with most standard shells, including PowerShell.
To install Terraform Workspace Selector, you can do either of the following:
- Install using Homebrew:
brew install abyss/tools/tfws - Download a binary from the GitHub releases page and put it in your PATH.
To use the Terraform Workspace Selector, just run tfws in a Terraform project with multiple workspaces.
Upon running the application, it will retrieve the list of Terraform workspaces and display an interactive prompt. Use the arrow keys or fuzzy search to navigate the options and press Enter to select a workspace. The selected workspace will be set using the terraform workspace select command.
Contributions in the form of issues and pull requests are welcome. 😄
This project is licensed under the ISC License.
Copyright (c) 2024 Abyss