tmux-workspace-cli
v1.0.2
Published
Interactive tmux workspace manager - Create, edit, and manage tmux workspaces with ease
Downloads
312
Maintainers
Readme
Tmux Workspace CLI
Interactive CLI tool for managing tmux workspaces easily.
Features
- 🎨 Interactive workspace creation - Build complex layouts step-by-step with navigation
- 📋 Full CRUD operations - Create, Read, Update, Delete, and Rename workspaces
- 🚀 Quick launch - Start workspaces with one command
- 💾 Configuration storage - JSON configs for easy editing
- 🔧 Flexible layouts - Support for horizontal/vertical splits, custom sizes
- ↩️ Navigation support - Go back and forth during creation/editing
Installation
Global Installation (Recommended)
npm install -g tmux-workspace-cliRequired directories will be created automatically on first use.
Local Development
git clone https://github.com/opengiver/tmux-workspace-cli.git
cd tmux-workspace-cli
npm install
npm linkUsage
Create a new workspace
tx createFeatures:
- Navigate back and forth during setup
- Review configuration before saving
- Edit any step before finalizing
This will guide you through:
- Naming your workspace
- Setting base directory
- Adding panes (horizontal/vertical splits)
- Configuring commands for each pane
- Setting custom sizes
- Review and confirm before creating
Load a workspace
tx load <workspace-name>Example:
tx load deepenqt
tx load byungskerlogList all workspaces
tx list
# or
tx lsInteractive mode (default):
- Shows all workspaces
- Use ↑↓ arrows to select
- Press Enter to load the selected workspace
Plain list mode:
tx ls --no-interactiveShows all workspaces with pane counts and base directories without selection.
Edit a workspace
tx edit <workspace-name>Edit options:
- Change base directory
- Add new panes
- Edit existing panes (command, split, directory, resize)
- Remove panes (except pane 0)
- Edit script directly in your editor
- Save and exit or cancel changes
Rename a workspace
tx rename <old-name> <new-name>
# or
tx mv <old-name> <new-name>Example:
tx rename myproject my-awesome-projectDelete a workspace
tx delete <workspace-name>
# or
tx rm <workspace-name>Requires confirmation before deletion.
Open config in editor
tx config # Open scripts directory
tx config <workspace-name> # Open specific workspace scriptNote: Make sure your EDITOR environment variable is set:
export EDITOR=vim
# or
export EDITOR=nvim
# or
export EDITOR="code --wait"Example Workflow
# 1. Create a new workspace with navigation
tx create
# Follow prompts, go back if you make mistakes, review before creating
# 2. Load the workspace
tx load myproject
# 3. List all workspaces
tx ls
# 4. Edit workspace (add a pane, change commands, etc.)
tx edit myproject
# 5. Rename if needed
tx rename myproject my-app
# 6. Delete when done
tx delete my-appDirectory Structure
~/.tmux-scripts/ # Generated bash scripts
~/.tmux-cli-configs/ # JSON configurationsTips
- Use
opencodeto open VS Code in tmux - Use
lazygitfor git management - Small panes (5-12 lines) work well for logs/status
- Main work pane should be 100-120 columns wide
- You can go back during
tx createto fix mistakes - Use
tx editto modify existing workspaces interactively - Use
tx configfor direct script editing
Troubleshooting
Editor not opening
If tx config or tx edit (with "Edit script directly") fails:
Check your EDITOR variable:
echo $EDITORSet it properly:
export EDITOR=vim # Add to ~/.zshrc or ~/.bashrc to persistFor editors that need wait flag:
export EDITOR="code --wait" export EDITOR="zed --wait"
Requirements
- tmux
- Node.js 18+
- bash
