itree is an interactively navigable version of the Linux utility tree, built in Rust. It aims to extend the functionality of tree, providing an intuitive view of a directory's structure in a manageable, interactively navigable command-line interface.
Whereas tree can be overwhelming to use on large directories, itree allows you to inspect a filesystem in an intuitive fashion, at your own pace. It also respects gitignore rules and supports folding, allowing you to focus on the files you're most interested in!
itree relies on the FS walker used by ripgrep, bringing you the usefulness of tree with as little overhead/slowdown as possible! (See benchmarks below for comparisons.)
tree |
itree |
|---|---|
![]() |
![]() |
![]() |
![]() |
itree is available via Homebrew! Simply run:
$ brew install sashaweiss/projects/itree
itree is also available on crates.io! Simply run:
$ cargo install itree
To build from source, first make sure you have Rust and cargo installed. (If not, then install via Rustup.) Then:
$ git clone https://github.com/sashaweiss/itree
$ cd itree
$ cargo install
Running itree will start an interactive CLI. Use itree --help to see a full list of configurations and UI options!
- Use the arrow keys to move around, as makes sense visually:
UpandDownmove between files in the same directory level, whileLeftandRightmove one level higher and lower in the directory tree, respectively.itreealso supports Vim keybindings -h,j,k, andlcan be used instead of the arrow keys.
- Use
fto fold/unfold a directory. - Use
q,Ctrl-C, orEscto exit.
Below are tables comparing the performance of itree to that of tree as well as to ripgrep (from which itree gets its filesystem iterator).
Tl;dr: itree is fast - much faster than tree, and not a huge slowdown over pure ripgrep! (Mostly thanks to BurntSushi's awesome ignore crate).
I used hyperfine for benchmarking - specifically, the command:
$ hyperfine --warmup 2 <CMD> --show-output
where <CMD> was filled in with the first column of the below tables. --show-output was used to avoid suppressing the output of each command, since printing/rendering is an important part of what tree and itree do. --warmup 2 caused each command to run twice before being measured, to potentially warm up caches.
Results shown are the mean and standard deviation reported by hyperfine. Each is the result of at least 10 measurements.
- The first row shows how long a user would wait for
itreeto display its UI. - The second row shows how long
itreetakes to exactly emulate the behavior oftree. - The third row shows how long
treetakes to draw a directory structure. - The final row shows how long
ripgreptakes to silently scan the directory structure. Sinceripgrepanditreeuse the same filesystem iterator, this represents a baseline for computingitree's overhead.
| Command | μ ± σ (run from my $HOME) |
μ ± σ (run in this repo) |
|---|---|---|
itree --no-ignore --no-exclude --quiet |
2.953s ± 0.070s | 0.012s ± 0.002s |
itree --no-ignore --no-exclude --no-interact |
3.511s ± 0.043s | 0.031s ± 0.010s |
tree |
15.005s ± 4.891s | 0.043s ± 0.014s |
rg --no-ignore --files --quiet |
1.373s ± 0.051s | 0.010s ± 0.014s |
- Write more comprehensive documentation of source code.
- Implement functionality similar to
tree -h. - Add commands for interacting with files under the cursor.
- Add command for
cd-ing to the folder the cursor is currently in.



