What zoxide Does
- Frecency ranking — frequency + recency scoring for visited dirs
- z command — jump to any tracked dir by partial name
- zi — interactive fuzzy picker (uses fzf)
- Multi-keyword match —
z proj apifinds~/code/myproject/api - Last dir —
z -toggles previous directory - Shell integrations — bash, zsh, fish, PowerShell, nushell, elvish, xonsh, cmd
- Directly callable —
zoxide query foofor scripting
Architecture
Rust binary that maintains a SQLite-like flat-file database at ~/.local/share/zoxide/db.zo. Each time you cd, the shell hook calls zoxide add $PWD. The z command queries the DB and returns the best match. Interactive mode pipes candidates to fzf.
Self-Hosting
Local CLI tool.
Key Features
- Cross-shell support
- Frecency algorithm
- Fast matching (Rust)
- Fuzzy interactive mode (zi)
- Import from z, autojump, fasd
- Scripting friendly
- Dead entries auto-cleaned
- No database maintenance needed
Comparison
| Tool | Algorithm | Shells | Database |
|---|---|---|---|
| zoxide | Frecency | All | Rust flat file |
| z (shell script) | Frecency | Bash/Zsh | Text file |
| autojump | Frequency | Bash/Zsh/Fish | Python |
| fasd | Frecency | Bash/Zsh | Shell script |
常见问题 FAQ
Q: 和 fzf 配合?
A: zi 自动用 fzf。设 _ZO_FZF_OPTS 环境变量定制样式。
Q: 怎么迁移 z 数据?
A: zoxide import --from z ~/.z。支持 autojump、fasd、z-lua 格式。
Q: Windows 能用? A: 能。PowerShell 和 cmd 都有 init hook。
来源与致谢 Sources
- GitHub: https://github.com/ajeetdsouza/zoxide
- License: MIT