Crates.io | itree |
lib.rs | itree |
version | 0.3.1 |
source | src |
created_at | 2018-06-13 19:35:51.531123 |
updated_at | 2018-06-24 00:15:54.978291 |
description | An interactively navigable version of the Linux utility `tree` |
homepage | https://github.com/sashaweiss/itree |
repository | https://github.com/sashaweiss/itree |
max_upload_size | |
id | 69999 |
size | 52,344 |
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
:-------------------------:|:-------------------------:
|
|
brew
itree
is available via Homebrew! Simply run:
$ brew install sashaweiss/projects/itree
cargo
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!
Up
and Down
move between files in the same directory level, while Left
and Right
move one level higher and lower in the directory tree, respectively.
itree
also supports Vim keybindings - h
, j
, k
, and l
can be used instead of the arrow keys.f
to fold/unfold a directory.q
, Ctrl-C
, or Esc
to 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.
itree
to display its UI.itree
takes to exactly emulate the behavior of tree
.tree
takes to draw a directory structure.ripgrep
takes to silently scan the directory structure. Since ripgrep
and itree
use the same filesystem iterator, this represents a baseline for computing itree
'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 |
tree -h
.cd
-ing to the folder the cursor is currently in.