Shell init (gcd helper)
A binary by itself cannot change the parent shell’s current directory: only the shell can. gwm shell-init <shell> prints a function (named gcd) that bridges two flows into one wrapper:
gcd <pattern>→gwm cd <pattern>(fuzzy resolve, exits0on a hit,1on miss / ambiguous / not in a repo).gcd(no argument) →gwm switch(interactive picker;Enterto commit,Esc/Ctrl-C/qto cancel with exit code1).
In both cases the wrapper only performs the cd after a successful exit code, so a cancelled picker or a missed pattern never strands you in $HOME.

Install
Section titled “Install”eval the wrapper in your shell’s rc file:
# zshecho 'eval "$(gwm shell-init zsh)"' >> ~/.zshrc
# bashecho 'eval "$(gwm shell-init bash)"' >> ~/.bashrc
# fish — also persist by adding to ~/.config/fish/config.fishgwm shell-init fish | source
# PowerShell — current session onlyInvoke-Expression (& gwm shell-init powershell | Out-String)# PowerShell — persist via $PROFILEgwm shell-init powershell | Out-File -Append -Encoding utf8 $PROFILEOpen a fresh shell (or source the rc file) and gcd is on your $PATH as a shell function.
gcd auth # → cd $(gwm cd auth) # → e.g. ~/cc-worktree/myrepo/feat-99-user-authentication
gcd # → cd $(gwm switch) # → opens the picker, cd's into the chosen worktreeThe pattern is matched with the same fuzzy engine used by the TUI filter (nucleo-matcher): auth matches feat-99-user-authentication, mig matches chore-12-rails-migration, etc. Ambiguity (two worktrees match equally well) exits 1 and prints both candidates so the wrapper does not cd.
Raw form (no wrapper)
Section titled “Raw form (no wrapper)”If you don’t want to install the wrapper, the raw forms work too:
cd "$(gwm cd auth)" # fuzzy resolve, $(...) captures the pathcd "$(gwm switch)" # open picker, type to narrow, Enter to commitgwm s # alias for `switch`Related
Section titled “Related”- TUI → Fuzzy filter: same engine, same matching rules
- CLI → Subcommand reference: full
gwm cdandgwm switchflags - CLI → Shell completions: drop a
_gwmcompleter that knows about worktree names