cdt
A neo-tree style terminal UI for picking a directory to cd into — browse the
tree, search it with ripgrep, press Enter, and your shell is there.
Install
Needs the rg binary on PATH for full-text search (s); browsing and
file-name search work without it.
Shell setup
A process cannot change its parent's directory, so cdt draws its UI on stderr
and prints only the chosen path to stdout. One shell function does the cd:
bash / zsh (~/.bashrc, ~/.zshrc):
PowerShell ($PROFILE):
function cdt { $d = cdt.exe @args; if ($d) { Set-Location $d } }
Usage
| key | |
|---|---|
j / k |
move |
l / Space / Tab |
expand / collapse a directory |
h |
collapse, then step out to the parent, then re-root one level up |
g / G |
first / last |
/ |
search file names (honours .gitignore) |
s |
full-text search with ripgrep |
. |
toggle hidden files |
Enter |
cd there and exit (a file resolves to its directory) |
q / Esc |
exit without changing directory |
/ does not need ripgrep installed: it uses ripgrep's own walker (the ignore
crate) as a library. s shells out to rg.
Libraries
The parts are published separately and usable on their own:
cdt-tree (tree model),
cdt-search (name and content search),
cdt-view (the ratatui picker).
Contributing
Workspace layout, dev commands, CI and the release procedure: .github/CONTRIBUTING.md.
License
MIT