Favicon of zoxide

zoxide

Command-line tool that tracks frequently visited directories and lets you jump to them with a few keystrokes, across all major shells.

zoxide is a command-line tool that replaces or augments cd, tracking which directories you visit most often so you can jump to them with just a few keystrokes instead of typing out full paths. It's built for developers who spend a lot of time in the terminal moving between project directories, and who are already familiar with tools like z or autojump, which zoxide is directly inspired by.

Key features

  • Frequency-based jumping: zoxide remembers directories you visit and ranks them, so z foo jumps to the highest-ranked directory matching "foo" rather than requiring an exact path.
  • Multi-term and partial matching: You can match on multiple terms (z foo bar) or match a subdirectory prefix (z foo /), and it still works as a regular cd when given a full path.
  • Interactive selection: The zi command adds interactive selection powered by fzf, for when you want to pick from several matching directories instead of jumping straight to the top match.
  • Shell completions: Typing z foo<SPACE><TAB> shows interactive completions in bash 4.4+, fish, and zsh.
  • Broad shell support: zoxide works across Bash, Zsh, Fish, PowerShell, Elvish, Nushell, Tcsh, Xonsh, and any POSIX-compliant shell.
  • Configurable scoring: The --hook flag controls when a directory's score increments, whether on every prompt, every directory change, or never, and --cmd lets you rename the commands or replace cd outright.
  • Data import from other tools: If you already use atuin, autojump, fasd, z, z.lua, or zsh-z, zoxide can import that history directly with zoxide import <plugin>.
  • Third-party integrations: Native or plugin-based support exists for file managers and tools including yazi, ranger, nnn, lf, felix, joshuto, Neovim, Emacs, tmux session managers, and more.

Ideal use cases

zoxide is a good fit for anyone who works from the command line regularly across a set of recurring project directories, especially developers juggling many repositories or nested folder structures where typing full paths gets tedious. Its cross-shell support means it works the same way whether you're on Bash at work, Zsh at home, or PowerShell on Windows, and the plugin ecosystem extends it into file managers and editors you may already use.

It's less useful if you rarely move outside a small, fixed set of directories, or if you already have a way of jumping around (aliases, a different tool, or a terminal multiplexer session manager) that covers your needs. It's also purely a directory-jumping aid: it doesn't manage sessions, files, or projects on its own, so it complements rather than replaces tools like tmux session managers or file managers, several of which it integrates with directly. Teams standardizing shell setup across a company may also want to weigh its per-user learned history against a shared, predictable set of aliases.

Installation

Installation is a four-step process: install the binary, hook it into your shell, optionally install fzf, and optionally import existing data from another tool.

On Linux, macOS, or via a package manager, the recommended install script works across most platforms:

curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh

Alternatively, use a package manager such as Homebrew, cargo, or your distribution's native package repository.

Add the shell hook to your config file. For Bash, add this to the end of ~/.bashrc:

eval "$(zoxide init bash)"

Zsh, Fish, PowerShell, and other supported shells use the equivalent zoxide init <shell> pattern, documented per-shell in the README.

Install fzf if you want interactive selection with zi; the minimum supported version is v0.51.0.

If migrating from another frequency-based navigation tool, import your existing data:

zoxide import autojump

Environment variables such as _ZO_DATA_DIR, _ZO_MAXAGE, and _ZO_EXCLUDE_DIRS allow further configuration of where data is stored, how large the database grows, and which directories are excluded from tracking.

zoxide also integrates with a long list of third-party tools beyond the shell itself. File managers including yazi, ranger, nnn, lf, felix, and joshuto support it natively or through a plugin, as do tmux session managers, the email client aerc, and editors such as Neovim and Emacs. If you already use one of those tools, check its documentation for whether zoxide support is built in or needs a small plugin installed alongside it.

Categories:

Frequently asked questions

Share:

Stars
37.9K
Forks
842
Last commit
3 days ago
Repository age
6 years
License
MIT
Self-hosted
No
Activity score
82/100
View Repository
Built with:

Similar to zoxide

Favicon

 

  
  
Favicon

 

  
  
Favicon