Installation
Requirements
- Node.js
18or newer for the CLI package. zshorbashif you wantgji go,gji new, andgji removeto change the current shell directory.- Git worktree support in your local Git installation.
Install the CLI
npm install -g @solaqua/gji
What to expect after install
After the package is installed:
gji statusworks immediately- path-printing modes like
gji root --printwork immediately - direct directory handoff still requires shell integration
Enable shell integration
gji can print paths for scripts without shell integration, but interactive navigation is much better once the shell hook is installed.
zsh
echo 'eval "$(gji init zsh)"' >> ~/.zshrc
source ~/.zshrc
bash
echo 'eval "$(gji init bash)"' >> ~/.bashrc
source ~/.bashrc
Verify the setup
gji status
gji init zsh
If shell integration is active, commands like gji new feature/foo and gji go main can hand your shell to the target path directly.
Optional next step: automate setup in each new worktree
Many users want installs, environment setup, or local configuration files to be ready automatically.
If every new worktree needs private files from your main worktree, register them first:
gji sync-files add .env.local .npmrc
gji stores that list in your global per-repo config and copies the files before setup hooks run.
Add an afterCreate hook:
{
"hooks": {
"afterCreate": ["pnpm", "install"]
}
}
Array hooks run without a shell and are the safer default for simple commands. If you need shell features in a string hook, quote context values with "$GJI_PATH", "$GJI_BRANCH", or "$GJI_REPO" instead of leaving template values unquoted.
Script-friendly mode
Use --print when you want the raw path instead of shell handoff:
path=$(gji go --print feature/dark-mode)
path=$(gji root --print)