CLI create¶
Create worktrees from local branches, issues, PRs, or interactive selection.
Examples¶
lazyworktree create # Auto-generated from current branch
lazyworktree create my-feature # Explicit name
lazyworktree create my-feature --with-change # Include uncommitted changes
lazyworktree create --from-branch main my-feature
lazyworktree create --branch main my-feature # --branch is an alias for --from-branch
lazyworktree create --from-pr 123
lazyworktree create --from-issue 42
lazyworktree create --from-issue 42 --from-branch main
lazyworktree create -I # Interactive issue selection
lazyworktree create -P # Interactive PR selection
lazyworktree create -P -q "dark" # Pre-filter interactive PR selection
lazyworktree create -I --query "login" # Pre-filter interactive issue selection
lazyworktree create --from-pr 123 --no-workspace
lazyworktree create --from-issue 42 --no-workspace
lazyworktree create my-feature --exec 'npm test'
lazyworktree create my-feature --exec 'npm test' --exec-mode direct
lazyworktree create my-feature --json # Machine-readable output
lazyworktree create my-feature --description "Implement login flow" --tags "auth,backend"
lazyworktree create my-feature --note "See RFC-42 for context"
lazyworktree create my-feature --note-file ./notes.md
Behaviour Notes¶
--execruns after successful creation.- With
--no-workspace,--execruns in current directory. - Shell execution uses your shell mode (
zsh -ilc,bash -ic, otherwise-lc). --exec-modecontrols how--execis invoked:login-shell(default): your$SHELLwith login/interactive flagsshell: your$SHELL -conly (non-interactive, faster)direct: splits the command string and execs without any shell wrapper
PR-specific branch behaviour:
- worktree name is generated from the configured template
- local branch name always matches the PR head branch name