wtman
A multi-repo git worktree manager with an interactive TUI and CLI. Creates feature branches across multiple repositories simultaneously, manages worktrees under a shared directory, and generates Cursor/VS Code multi-root workspace files.
Prerequisites
brew install go git
- Go 1.26 or newer — install via Homebrew or from go.dev.
- git — required at runtime for all worktree operations
- macOS — the approval watcher uses
osascript and script (both ship with macOS)
Build
go build -o wtman .
Install
Homebrew (recommended, macOS)
brew install --cask alexiezhov/apps/wtman
This taps alexiezhov/homebrew-apps and installs the latest release. Upgrade with brew upgrade --cask wtman.
From source
Copy the binary somewhere on your PATH:
go build -o wtman . && mv wtman ~/.local/bin/
Or install directly:
go install github.com/alexiezhov/wtman@latest
Configuration
Config file: ~/.config/wtman/config.json
{
"source_dir": "/path/to/repos",
"target_dir": "/path/to/branches",
"post_command": "agent {{dir}}",
"scan_depth": 1,
"log_level": "info"
}
source_dir — directory containing your git repositories
target_dir — directory where feature branch worktrees are created
log_level — logging verbosity: debug, info, warn, error, or off (default info). Logs are written to stderr.
post_command — shell command run after worktrees are created; {{dir}} is replaced with the branch directory path, and {{workspace}} with the absolute path to the generated .code-workspace file. For example:
"open {{workspace}}" - opens workspace in Cursor IDE
"tmux split-window -h \"zsh -c 'cd {{dir}} && tmux select-pane -T \\\"${PWD##*/}\\\"; cursor-watcher agent; exec zsh'\"" - runs Cursor CLI with Cursor Approval Watcher (see below) in a new tmux pane
scan_depth — how deep to look for git repos in source dir
Usage
Run without arguments to launch the interactive TUI:
wtman
CLI commands for scripting:
wtman ls # List feature branches (JSON)
wtman repos # List available source repos (JSON)
wtman new <branch> <repos> [-n] [--from <ref>] # Create branch with worktrees (-n skips post hook; --from sets the base ref)
wtman rm <branch> [-f] # Delete branch (-f force even if dirty)
wtman update <branch> <repos> [-f] # Set repos for branch (-f force dirty removal)
wtman mv <old> <new> # Rename branch
wtman pull # Pull all repos under source_dir
By default, new branches are created from each repo's main/master. Pass --from <ref> to base them on another branch, tag, or commit instead (resolved per repo as a local ref, then origin/<ref>):
wtman new my-feature auth,billing --from develop
Flags (-n, --from, -f) may appear before, after, or interspersed with the positional arguments.
Enable verbose logging:
wtman -v ls # debug logs on stderr
wtman --log-level warn new feat-x auth,billing
Cursor Approval Watcher
watcher.sh is a wrapper script that monitors a command's output for Cursor approval prompts and sends a macOS notification when one is detected.
When running Cursor in agent/CLI mode, it sometimes pauses to ask "Run this command?" before executing shell commands. If you're working in another window, you won't notice the prompt. The watcher solves this by sending a desktop notification so you can switch back and approve it.
Install the watcher
Copy watcher.sh somewhere on your PATH:
cp watcher.sh ~/.local/bin/cursor-watcher
chmod +x ~/.local/bin/cursor-watcher
Usage
Wrap any command that might produce Cursor approval prompts:
cursor-watcher agent
Or use it with any long-running command where Cursor is operating:
cursor-watcher <command> [args...]
When the output contains a line matching "Run this command?" (case-insensitive), a macOS notification is sent:
Cursor needs approval
Command approval needed
Requirements
- macOS (uses
osascript for notifications)
script command (standard on macOS)
How it works
- Runs the given command under
script to capture its output (preserving TTY behavior)
- Tails the output file in the background
- When a line matches the approval pattern, triggers
osascript to display a notification
- Cleans up the temp file on exit