open
Opens or switches to a tmux window for a pre-existing git worktree. If the window already exists, switches to it. If not, creates a new window with the configured pane layout and environment.
bash
workmux open <name> [flags]Arguments
<name>: Worktree name (the directory name, which is also the tmux window name without the prefix). This is the name you see in your tmux window list.
Options
| Flag | Description |
|---|---|
-n, --new | Force opening in a new window even if one already exists. Creates a duplicate window with a suffix (e.g., -2, -3). Useful for having multiple terminal views into the same worktree. |
--run-hooks | Re-runs the post_create commands (these block window creation). |
--force-files | Re-applies file copy/symlink operations. Useful for restoring a deleted .env file. |
-p, --prompt <text> | Provide an inline prompt for AI agent panes. |
-P, --prompt-file <path> | Provide a path to a file containing the prompt. |
-e, --prompt-editor | Open your editor to write the prompt interactively. |
What happens
- Verifies that a worktree with
<name>exists. - If a tmux window exists and
--newis not set, switches to it. - Otherwise, creates a new tmux window (with suffix if duplicating).
- (If specified) Runs file operations and
post_createhooks. - Sets up your configured tmux pane layout.
- Automatically switches your tmux client to the new window.
Examples
bash
# Open or switch to a window for an existing worktree
workmux open user-auth
# Force open a second window for the same worktree (creates user-auth-2)
workmux open user-auth --new
# Open with a prompt for AI agents
workmux open user-auth -p "Continue implementing the login flow"
# Open and re-run dependency installation
workmux open user-auth --run-hooks
# Open and restore configuration files
workmux open user-auth --force-files