Move your shell with your task
Shell integration makes gji new, gji go, and gji back land you in the
selected worktree. A normal CLI process cannot change its parent shell's
directory, so a small shell wrapper performs that last step.
Install once
gji init
Restart your shell, or load the rc file shown by the wizard. Then verify:
gji doctor
The wizard configures the wrapper and completions and lets you save an editor. For an explicit shell, run one of:
gji init zsh --write
gji init bash --write
gji init fish --write
Try it in the current session
For zsh or bash, load the wrapper without writing your rc file:
eval "$(gji init zsh)"
# In bash, use: eval "$(gji init bash)"
For fish:
gji init fish | source
To review the wrapper first, run gji init zsh, gji init bash, or
gji init fish without --write.
What changes in daily use
| Command | Your shell ends up in… |
|---|---|
gji new feature/search | The new task's worktree |
gji pr 1234 | The PR's worktree |
gji go feature/payments | An existing destination worktree |
gji back | The previously visited worktree |
gji root | The main repository checkout |
Navigation doesn't transfer uncommitted changes. They stay in the worktree where you made them.
Print paths for scripts
You don't need shell integration when you only want the destination path:
gji go --print feature/payments
gji root --print
For example, in zsh or bash:
cd "$(gji go --print feature/payments)"
Reload after an update
Restart your shell, or load its wrapper again using the session-only commands
above. If gji go still prints a path instead of moving, check that the
integration was loaded in the shell you're actually using. See
troubleshooting.