Quickly set up your tmux workspace by splitting a window into multiple panes at a specified directory with a single command.
When working with tmux, you often want to set up the same pane layout repeatedly - multiple panes all navigated to your project directory. Manually splitting panes and navigating each one to the right directory becomes tedious, especially when opening new tmux windows frequently.
TSPS automates this repetitive setup process. Instead of manually:
- Creating each pane
- Navigating to your project directory in each pane with
cd /path/to/project - Arranging panes to your preferred layout
You can now simply run: tsps 4 /path/to/project or tsps -l dev.yaml -d /path/to/project and get your ideal workspace instantly.
20250615-tsps-demo.mov
cargo install tsps# Download the latest release
curl -L https://github.com/yyossy5/tsps/releases/latest/download/tsps-aarch64-apple-darwin -o tsps
# Make it executable
chmod +x tsps
# Move to your PATH
mv tsps ~/.local/bin/# Create 4 panes, all navigated to /path/to/project
tsps 4 /path/to/project
# Create 3 panes in current directory
tsps 3 .
# Create 2 panes in home directory
tsps 2 ~You can define custom layouts using YAML files for more complex workspace setups:
# Use a predefined layout file
tsps --layout examples/dev.yaml
# Or use the short form
tsps -l examples/simple.yaml
# Override the directory specified in the layout file
tsps --layout examples/dev.yaml --directory /path/to/different/project
# Short form with directory override
tsps -l examples/dev.yaml -d /path/to/projectSee the examples directory.
- Create specified number of panes in current tmux window
- All panes automatically navigate to specified directory
- Alternates between horizontal and vertical splits
- Automatically arranges panes in tiled layout
- Error handling (tmux session check, directory validation, etc.)
- Define custom workspace layouts with YAML files
- Execute specific commands in each pane automatically
- Control pane split directions (horizontal/vertical)
- Set initial focus on specific panes
- Add descriptions and identifiers to panes
- Create reusable workspace templates
- Override layout directory with command line argument
name: Layout name for identificationdescription: Optional description of the layoutdirectory: Base directory for all panes (can be overridden with--directoryoption)
id: Optional identifier for the panesplit: Split direction (horizontalorvertical)commands: List of commands to execute in the panefocus: Set totrueto focus this pane initiallysize: Pane size specification (percentage like "30%" or lines/columns like "10")
The project includes several example layout files in the examples/ directory:
examples/simple.yaml- Basic 2-pane editor + terminal setupexamples/dev.yaml- 4-pane development workspace
Use these as templates for your own custom layouts!
The --directory (-d) option allows you to reuse the same layout file across different projects:
# Use the same layout in different projects
tsps -l ~/layouts/dev.yaml -d ~/projects/frontend
tsps -l ~/layouts/dev.yaml -d ~/projects/backend
tsps -l ~/layouts/dev.yaml -d ~/projects/mobileThis is particularly useful when you have standardized development workflows but work on multiple projects.
panes:
# Main editor (no size = uses remaining space)
- id: "editor"
commands: ["nvim ."]
# Sidebar taking 30% of width
- id: "sidebar"
split: "vertical"
size: "30%"
commands:
- "ls -la"
# Bottom pane with fixed 15 lines height
- id: "terminal"
split: "horizontal"
size: "15"
commands:
- "htop"cargo install tsps --force
# If you have cargo-update package
cargo install-update tsps# Download the latest release
curl -L https://github.com/yyossy5/tsps/releases/latest/download/tsps-aarch64-apple-darwin -o tsps
# Make it executable
chmod +x tsps
# Replace the existing binary
mv tsps ~/.local/bin/cargo uninstall tspsrm ~/.local/bin/tsps