Skip to main content

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​

CommandYour shell ends up in…
gji new feature/searchThe new task's worktree
gji pr 1234The PR's worktree
gji go feature/paymentsAn existing destination worktree
gji backThe previously visited worktree
gji rootThe main repository checkout

Navigation doesn't transfer uncommitted changes. They stay in the worktree where you made them.

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.