- Module renamed to
github.com/todoengineering/wt - Fixed bug where editor didn't open in tmux session context
- Enhanced repository name detection for worktrees
- Implemented TOML configuration system with XDG compliance
- Added file copying feature for untracked files (.env, certificates, etc.)
- Initialize Go module structure
- Set up Cobra CLI framework
- Create project directory structure
- Implement basic
worktree listcommand- Check if in Git repository
- Get repository name
- List worktrees from standard directory
- Sort worktrees alphabetically
- Validate Git repository context
- Create new Git branch
- Create worktree directory structure
- Run
git worktree addcommand - Open in configured editor ($EDITOR)
- Create/switch tmux session
- Handle interactive mode (prompt for name)
- Copy configured files to new worktree
- Interactive worktree selection with fzf
- Direct selection by name
- Open in configured editor
- Create/switch tmux session
- Handle editor in tmux session context
- Check fzf availability
- List all projects in worktree base directory
- Interactive project selection with fzf
- List worktrees for selected project
- Interactive worktree selection with fzf
- Open in configured editor
- Create/switch tmux session
- Check fzf availability
- Fetch remote branches
- List all branches (local and remote)
- Filter out current branch and HEAD
- Interactive branch selection with fzf
- Check if worktree already exists
- Create worktree for selected branch
- Handle special characters in branch names
- Open in configured editor
- Create/switch tmux session
- Check fzf availability
- List all worktrees for current repo
- Interactive worktree selection with fzf
- Show confirmation prompt
- Validate confirmation input
- Prevent deletion of main worktree
- Run
git worktree remove --force - Clean up orphaned directories
Goal: Make the tool simpler and more intuitive by consolidating overlapping commands, introducing consistent flags, and clarifying defaults. This plan captures the intended changes with examples and acceptance criteria.
-
Collapse
wt switchintowt open- Behavior:
wt openopens an existing worktree and switches/creates a tmux session, and opens the editor (current behavior of bothopenandswitch). - Scope default: If inside a Git repo, list that repo’s worktrees; if outside, list across projects.
- Remove
wt switchcommand entirely (no deprecation alias needed). - Acceptance:
- Running
wt openin a repo shows only that repo’s worktrees. - Running
wt open --allshows a project → worktree picker across all projects. wt switchcommand is no longer available.
- Running
- Behavior:
-
Rename
wt checkouttowt branchOR merge intowt new --from- Chosen: Option A - Merge into
wt newwith a--from <branch>flag to attach a new worktree to an existing branch.- Example:
wt new feature-login --from origin/feature-login - Example:
wt new --from origin/release-1.2(auto name from branch) - Benefit: Fewer top-level commands; a single verb to “add a worktree”.
- Example:
- Acceptance:
- Users can create a worktree from an existing branch via
new --from. - Existing “worktree already exists” detection still offers to switch instead of duplicating.
- Users can create a worktree from an existing branch via
- Notes:
- Removed
checkoutcommand (no deprecation alias needed; not yet live).
- Removed
- Chosen: Option A - Merge into
-
--no-editor: Skip launching the editor after create/open- Applies to:
open,new - Example:
wt open --no-editor
- Applies to:
-
--no-tmux: Skip creating/switching tmux sessions- Applies to:
open,new - Example:
wt new ticket-42 --no-tmux
- Applies to:
-
--forceon delete: Skip confirmation prompt- Applies to:
delete - Example:
wt delete ticket-42 --force
- Applies to:
-
Scope flags
-
--allfor cross-project operations- Applies to:
open,list - Examples:
wt open --all→ project → worktree picker across all projectswt list --all→ list all projects and their worktrees
- Applies to:
-
--project <name>to filter to a specific repository (when outside any repo)- Applies to:
open,list - Status: Implemented for
open(flag--project); pending forlist. - Example:
wt open --project my-repo
- Applies to:
-
Output flags for scripting on
list -
--json→ machine-readable output -
--path-only→ just the filesystem paths (one per line)- Examples:
wt list --json | jq '.'wt list --path-only | xargs -I{} du -sh {}
- Examples:
-
opendefault scope:- In a repo → list only that repo’s worktrees (skip project selection).
- Outside a repo → show project → worktree interactive selection.
- Acceptance: Behavior matches above without requiring flags.
-
open <worktree-name>shortcut when inside a repo- Example:
wt open feature-xjumps directly if it exists; otherwise shows friendly error with suggestions.
- Example:
-
open --allaccepts<repo>/<worktree>to jump directly- Example:
wt open --all my-repo/feature-x
- Example:
-
ls→list -
rm→delete
- When i run "wt open --all --json" is doesn't output json
- Before → After
wt switch→wt open(orwt open --alloutside a repo)wt checkout→wt new --from <branch>wt list→ unchanged; add--all,--json,--path-onlywt delete→ unchanged; add--force
Examples:
# Open an existing worktree in current repo
wt open
wt open payment-refactor
# Open across projects
wt open --all
wt open --all my-repo/payment-refactor
# Create worktree on a new branch
wt new feature/signup-flow
# Create worktree from an existing branch
wt new release-1.2 --from origin/release-1.2
# List worktrees
wt list
wt list --all
wt list --json
wt list --path-only
# Delete worktree
wt delete feature/signup-flow
wt delete feature/signup-flow --force
# Suppress integrations when desired
wt open --no-editor
wt new feature/foo --no-tmux- Print a one-line deprecation notice when
switchorcheckoutare used, pointing to the replacement command. - Keep aliases for at least one minor release cycle.
- Update
--helpfor root and affected commands with new flags and examples.
- Wire
--no-editorand--no-tmuxthrough editor/tmux helpers without breaking defaults. - Add
--alland--projectplumbing toopen/listselection paths. - Add JSON and path-only output modes to
listwith stable schema. - Rename
checkout→branchOR add--fromtonewand removecheckout. - Implement aliasing + deprecation messages.
- Update README command docs and usage examples.
- Consider shell completions update once flags settle (bash/zsh/fish).
- Read $EDITOR environment variable
- Parse editor command with flags
- Validate editor availability
- Handle editor launch errors
- Support common editors (code, vim, emacs, etc.)
- Check if tmux is installed
- Detect if running inside tmux
- Create detached tmux sessions
- Switch between tmux sessions
- Attach to tmux sessions from outside
- Handle session name conflicts
- Check Git installation
- Validate Git repository
- Get current branch
- List local branches
- List remote branches
- Create new branches
- Run worktree commands
- Create directory structures
- Clean up orphaned directories
- Validate paths
- Handle permissions errors
- Check fzf installation
- Create fzf selection interfaces
- Handle user input prompts
- Display progress indicators
- Show error messages
- Support WORKTREE_BASE_DIR environment variable
- Default to ~/projects/worktrees
- Validate configuration values
- Handle missing configuration gracefully
- XDG-compliant config file support (TOML)
- Global config at ~/.config/wt/config.toml
- Local project config at .wt.toml
- Config merging (local overrides/extends global)
- Configurable worktrees location
- Copy files to new worktrees (copy_files config)
- Support glob patterns in copy_files
- Validate all dependencies on startup
- Provide clear error messages
- Handle edge cases gracefully
- Add recovery suggestions
- Log errors appropriately
- Unit tests for Git operations
- Unit tests for worktree management
- Integration tests for commands
- Test tmux integration
- Test editor integration
- Test error scenarios
- Write README with installation instructions
- Document all commands with examples
- Create man page
- Add inline help text
- Document configuration options
- Set up build scripts
- Create Makefile
- Configure CI/CD pipeline
- Create release binaries for multiple platforms
- Set up versioning strategy
- Create installation script
- Shell completions (bash, zsh, fish)
- Worktree status command
- Sync command for updating worktrees
- Config file support (TOML) - Completed
- Parallel worktree operations
- Cleanup command for orphaned worktrees
- Integration hooks for IDEs
- Worktree templates