This guide covers all gj commands in detail, including matching rules, TUI keybindings,
and practical examples.
gj [pattern...]
The jump command is the core of gj. It finds a matching project, changes the shell's working
directory to that project, and applies all configured git config, environment variables, and
hooks.
gj uses multi-token substring matching:
- The pattern is split into tokens by whitespace.
- Each token must appear as a case-insensitive substring somewhere in the project's display
path (e.g.
github.com/my-org/backend-apior its alias equivalent). - All tokens must match (AND logic). A project is excluded if any token fails to match.
gj api # matches any project containing "api"
gj api gate # matches projects containing both "api" AND "gate"
gj org backend # matches projects in "org" group with "backend" in the nameWhen multiple projects match, gj ranks them by coverage score:
- Project score: how much of the project name is covered by the matched tokens. A token that covers a larger fraction of the project name scores higher.
- Group score: average coverage across group path components.
Projects with higher project scores appear first. This means gj api will rank api above
api-gateway when both match, because the token covers 100% of api but only part of
api-gateway.
When exactly one project matches, gj jumps to it immediately without showing the TUI.
gj backend-api # jumps directly if only one project matchesWhen multiple projects match (or when called with no arguments), gj opens an interactive
TUI selector:
> api_
github.com/my-org/backend-api
github.com/my-org/api-gateway
git.example.com/backend/api
The top bar is a live filter input. Type to narrow results in real time.
| Key | Action |
|---|---|
| Type text | Filter projects in real time |
Up / Down |
Move selection up/down |
Tab |
Move selection down |
Shift+Tab |
Move selection up |
Enter |
Jump to selected project |
Esc |
Cancel (exit without jumping) |
Ctrl+C |
Cancel (exit without jumping) |
Ctrl+U |
Clear the filter input |
# Jump to a project by name
gj my-repo
# Multi-token: project must contain both "backend" and "api"
gj backend api
# Open interactive selector (no pattern)
gj
# Match by alias prefix
gj work api # "work" is an alias for a domain
# Match by partial name
gj gate # matches "api-gateway", "gate-service", etc.gj .
Jumps to the git root of the current repository and loads its configuration. This is useful when you are already inside a project directory and want to apply the project's config (git identity, env vars, hooks) without navigating away.
- Detects the git root by walking up from the current directory until a
.gitdirectory is found. - Checks whether the git root is a domain project (under
$_GIT_JUMP_ROOT/<domain>/...). - Loads and merges the appropriate config chain.
- Outputs shell commands to
cdto the git root and apply the config.
gj . works for both domain projects and non-domain projects. For non-domain projects, config
is loaded by scanning .git-jump.toml files from / down to the git root.
gj . does not require git-jump setup to have been run -- it works even without a global
config file.
When . appears alongside other tokens, it is expanded to the current directory name:
# If cwd is ~/code/git.example.com/backend/api
gj . service # expands to: gj api serviceThis lets you quickly find sibling projects in the same group.
gj
Opens the interactive TUI selector with all projects listed. If you are currently inside a git repository that is a known domain project, that project is pinned to the top of the list.
This is the fastest way to browse all available projects when you do not have a specific target in mind.
gjclone <url> [args...]
gjclone is a shell function (not a binary subcommand) that:
- Runs
git-jump clone <url>to clone the repository into the organized directory structure. - Runs
gj .on the cloned directory to jump to it and load its config.
Both HTTPS and SSH URL formats are supported:
# HTTPS
gjclone https://github.com/my-org/my-repo
# SSH
gjclone git@github.com:my-org/my-repo.git
# GitLab
gjclone https://gitlab.com/my-org/my-repo
gjclone git@gitlab.com:my-org/my-repo.gitThe URL is parsed to extract the domain, group path, and project name. The repository is cloned
to $root/<domain>/<groups>/<project>.
Any arguments after the URL are passed through directly to git clone:
# Shallow clone
gjclone https://github.com/my-org/my-repo --depth 1
# Clone specific branch
gjclone https://github.com/my-org/my-repo --branch develop
# Combined options
gjclone https://github.com/my-org/my-repo --depth 1 --single-branch --branch mainWhen using git-jump directly, the --debug flag must come before the subcommand:
git-jump --debug clone https://github.com/my-org/my-repo --depth 1On the first clone to a new domain, gj automatically creates a domain-level .git-jump.toml
with pre-filled settings:
- github.com, gitlab.com, bitbucket.org:
web_url_templateis set to the correct format for that host. - Other domains: all
web_url_templateoptions are commented out with examples for each format. Edit the file to activate the correct one.
A hint is printed to stderr pointing to the new config file.
If the target directory already exists, gjclone skips the clone step and jumps directly to
the existing directory. This makes gjclone idempotent -- safe to run multiple times.
| Domain | Auto-configured web_url_template |
|---|---|
github.com |
https://{domain}/{groups}/{project}/tree/{branch}/{path} |
gitlab.com |
https://{domain}/{groups}/{project}/-/tree/{branch}/{path} |
bitbucket.org |
https://{domain}/{groups}/{project}/src/{branch}/{path} |
git-jump browse [pattern...]
Opens the project's web page in a browser. The URL is constructed from the web_url_template
config field.
Priority order:
web_url_templatefrom the merged config chain (domain/group/project.git-jump.toml).- Default inference:
https://{domain}/{groups}/{project}(domain projects only, no template required). - Error: non-domain projects without a
web_url_templatecannot be browsed.
When {branch} appears in the template, gj runs git rev-parse --abbrev-ref HEAD to detect
the current branch. When {path} appears, gj uses the current working directory relative to
the git root.
This means git-jump browse (no args, run from inside a project subdirectory) opens the
browser at the exact file or directory you are currently viewing.
git-jump browseWhen called without a pattern, gj detects the current project from the working directory:
- Walks up from cwd to find a
.gitdirectory inside the root. - If found and the domain is registered, uses that as the current project.
- Falls back to non-domain detection (git root anywhere on the filesystem).
git-jump browse api
git-jump browse work backendPattern matching follows the same rules as the jump command (multi-token substring, AND logic, coverage-based scoring). When multiple projects match, the TUI selector opens.
By default, gj uses the system default browser (via the webbrowser crate). To use a
specific browser, set the browser field in the global config:
# ~/.config/git-jump/config.toml
browser = "firefox --new-tab {url}"The {url} placeholder is replaced with the constructed URL.
Non-domain projects can be browsed if a web_url_template is set in a .git-jump.toml along
the path from / to the git root. The template can use static URLs (no placeholders) or any
combination of the available variables.
# Browse current project (opens at current subdirectory if {path} in template)
git-jump browse
# Browse a specific project by pattern
git-jump browse my-repo
# Browse with multi-token pattern
git-jump browse work backendgit-jump --debug <subcommand>
The --debug flag is a global option that prints diagnostic information to stderr. It works
with any subcommand.
- Resolved root directory and known domains
- Pattern matching: candidates considered, scores, selected project
- Config chain: which
.git-jump.tomlfiles were loaded at each level - Merged config values (git_config, env, hooks, web_url_template)
- Shell commands that will be eval'd
- For browse: URL source (template vs default inference), branch, path, final URL
- For clone: parsed repo URL, target directory, git clone exit code and duration
- Total elapsed time
# Debug a jump
git-jump --debug jump api
# Debug browse URL construction
git-jump --debug browse my-repo
# Debug clone
git-jump --debug clone https://github.com/my-org/my-repo
# Debug current project detection
git-jump --debug jump .Note: gj --debug does not work directly because gj is a shell function that wraps
git-jump jump. Use git-jump --debug jump <pattern> instead.
| Command | Description |
|---|---|
gj [pattern...] |
Jump to matching project (shell function) |
gj . |
Jump to current git project root and load config |
gjclone <url> [args...] |
Clone repo into organized structure and jump; extra args passed to git clone |
git-jump jump [pattern...] |
Jump (binary subcommand, used by gj shell function) |
git-jump browse [pattern...] |
Open project web page in browser |
git-jump clone <url> [args...] |
Clone repo and print target path; extra args passed to git clone |
git-jump setup |
Interactive first-time configuration wizard |
git-jump init [shell] |
Output shell integration script for bash/zsh/fish |
git-jump completions <shell> [partial] |
Generate tab completion candidates |
git-jump logo [text] |
Render text as FIGlet ASCII art |
git-jump --debug <subcommand> |
Print debug info to stderr |
gj and gjclone are shell functions installed by git-jump init. They wrap the binary and
eval its stdout to change the working directory and apply environment variables in the parent
shell. This is the same pattern used by zoxide.
The binary itself cannot change the parent shell's cwd or env directly -- it outputs shell
commands to stdout, and the shell function evals them.
Tab completion is registered automatically by git-jump init. It calls
git-jump completions <shell> <partial> to generate candidates, sorted by coverage score.
gj back<Tab> # completes to matching project names
gj work <Tab> # completes projects under the "work" aliasIf you have not run git-jump setup, add shell integration manually:
Bash (~/.bashrc):
eval "$(git-jump init bash)"Zsh (~/.zshrc):
eval "$(git-jump init zsh)"Fish (~/.config/fish/config.fish):
git-jump init fish | sourceAfter adding the line, reload your shell or open a new terminal.
| Variable | Description |
|---|---|
$_GIT_JUMP_ROOT |
Overrides root from global config |
$_GIT_JUMP_INITIALIZED |
Set by shell integration to prevent double-init |
$_GIT_JUMP_LOGO_TEXT |
Set on each jump; used by shell function to detect env change |