- Instant project switching — jump to any repo by name with fuzzy matching
- Structured organisation — repos are cloned into a consistent
owner/repolayout - GitHub shorthand —
gx clone user/repojust works - Shell integration — tab completion and auto-
cdfor zsh, bash, fish, and PowerShell - Open in any editor —
gx openlaunches VS Code, nvim, or whatever you use - AI agent scaffolding —
gx initgenerates.claude/configs tailored to your project's language - Installation health checks —
gx doctorverifies the binary, shell integration, config, and index - Single binary — zero runtime dependencies, compiled from Rust
# Install (macOS / Linux)
curl -fsSL https://raw.githubusercontent.com/joshuaboys/gx/main/install.sh | sh
exec $SHELL # reload to pick up PATH and shell integration
# Clone a repo and cd into it
gx clone user/repo
# Jump back to it later
gx myprojectWindows PowerShell:
irm https://raw.githubusercontent.com/joshuaboys/gx/main/install.ps1 | iexThat's it. Shell integration and tab completion are set up automatically.
The installer downloads the gx binary (verifying its SHA-256 checksum), puts it on your PATH, and sets up shell integration with tab completion.
macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/joshuaboys/gx/main/install.sh | shWindows (PowerShell):
irm https://raw.githubusercontent.com/joshuaboys/gx/main/install.ps1 | iexThe Windows installer verifies gx-windows-x64.exe against the release SHA256SUMS manifest, installs it to %LOCALAPPDATA%\gx\bin, and adds that directory to your user PATH. x86_64 only; ARM64 Windows is not published yet.
Git Bash can use gx shell-init bash once gx.exe is on PATH. WSL should use the Linux installer above.
Note: Shell integration is required for
gxtocdinto projects. The installer sets this up automatically. If you installed manually, addeval "$(gx shell-init)"for bash/zsh,gx shell-init | sourcefor fish, orInvoke-Expression (& gx shell-init powershell | Out-String)for PowerShell.
Manual install
Requires a Rust toolchain (1.75+).
git clone https://github.com/joshuaboys/gx
cd gx
cargo build --release
cp target/release/gx ~/.local/bin/ # Unix
# copy target\release\gx.exe %LOCALAPPDATA%\gx\bin\ # WindowsAdd shell integration to your config file:
zsh (~/.zshrc) / bash (~/.bashrc):
eval "$(gx shell-init)"fish (~/.config/fish/conf.d/gx.fish):
gx shell-init | sourcePowerShell ($PROFILE):
Invoke-Expression (& gx shell-init powershell | Out-String)oh-my-zsh (legacy)
If you already use gx as an oh-my-zsh plugin, it still works:
ln -s /path/to/gx/plugin ~/.oh-my-zsh/custom/plugins/gx
# add gx to plugins=(...) in ~/.zshrcThe plugin file now delegates to gx shell-init internally.
gx myproject # exact match
gx myproj # fuzzy match fallbackTab completion works for all indexed project names.
gx clone user/repo # GitHub shorthand
gx clone https://github.com/user/repo
gx clone git@github.com:user/repo.gitRepositories are cloned to ~/Projects/src/<owner>/<repo> by default and the shell cds into the new directory.
Pass an optional path to land a single clone outside the configured layout, without changing any config:
gx clone user/repo put-it-here # -> ./put-it-here
gx clone user/repo /tmp/scratch # -> /tmp/scratchRelative paths resolve against the current directory, the same as git clone.
The clone is still indexed — under the destination's directory name, so
gx put-it-here jumps back to it. Everything else is unchanged: missing parent
directories are created, an existing clone at the destination is skipped, and
projectDir / structure are left alone.
gx lsgx open myproject # uses default editor
gx open myproject --editor code # override editor
gx open # open current directoryEditor resolution order: --editor flag > gx config editor > $VISUAL > $EDITOR > nano
gx init # auto-detect project type
gx init --type rust # override detection
gx init --force # overwrite existing .claude/Creates .claude/CLAUDE.md and .claude/commands/ with plan and review slash commands. Supports project types: typescript-bun, typescript-node, rust, go, python, generic.
gx rebuildRescans the project directory and rebuilds the project index.
gx doctorReports whether the gx binary is on PATH, shell integration is configured, config/index paths exist, and indexed projects point at existing directories.
gx config # show current config
gx config set projectDir ~/code # change project directory
gx config set structure flat # use repo-only layout
gx config set structure owner # use owner/repo layout (default)
gx config set structure host # use host/owner/repo layout
gx config set editor code # set default editorConfig is stored at ~/.config/gx/config.json.
owner (default) | flat | host |
|---|---|---|
|
|
|
rm ~/.local/bin/gxRemove the # gx block from your shell config file (~/.zshrc, ~/.bashrc, or ~/.config/fish/conf.d/gx.fish).
- Use cases & examples — real-world workflows, scripting recipes, and shell aliases
- Contributing — development setup and guidelines
gx draws inspiration from these projects:
- ghq — the original structured repository manager. ghq pioneered the
host/owner/repodirectory layout and index-based project lookup that gx builds on. - gclone — a git clone helper with automatic directory organisation, shorthand URL parsing, and shell auto-cd. gx's clone workflow and shell integration owe a lot to gclone's approach.
MIT
