Workspace
Overview
The Workspace plugin lists all terraform workspaces, highlights the current one, and lets you switch between them, create new workspaces, or delete unused ones. The current workspace is marked with an asterisk.
Interactive (TUI)
Press w, or pick Workspace in Context, to open the Workspace view. It loads the workspace list from the current terraform configuration.
Keybindings
| Key | Action | When |
|---|---|---|
j / k |
Navigate up/down | List |
Enter |
Switch to selected workspace and go back | List |
s |
Switch to selected workspace and stay in the list | List |
n |
Create a new workspace | List |
d |
Delete selected workspace (not the current or default workspace) |
List |
ctrl+r |
Refresh workspace list | List |
Esc |
Go back / cancel create | Always |
Flow
Home ──w──→ Workspace (list)
│
├── Enter → workspace switches → back to where you came from
├── s → workspace switches → stay in the list
├── n → Input name → Enter → workspace created
├── d → Confirm delete → deleted, refresh
└── Esc → Cancel → back to where you came from
Command Line (CLI)
tfui workspace show # Print current workspace name
tfui workspace list # List all workspaces (current marked with *)
tfui workspace select <name> # Switch to workspace
tfui workspace new <name> # Create and switch to workspace
tfui workspace delete <name> # Delete workspace
Flags (-lock, -lock-timeout, -force): see tfui workspace.
Exit codes: see CLI I/O contract.
Equivalence
| Goal | CLI | TUI |
|---|---|---|
| List workspaces | tfui workspace list |
Press w |
| Switch workspace | tfui workspace select <name> |
w → navigate → Enter |
| Create workspace | tfui workspace new <name> |
w → n → type name → Enter |
| Delete workspace | tfui workspace delete <name> |
w → navigate → d → confirm |
Related
- State Browser – browse state for the selected workspace
- Context – manage project/chdir/workspace selection