lstr Brandon Greenwell
winget install --id=bgreenwell.lstr -e A fast, minimalist directory tree viewer, written in Rust
winget install --id=bgreenwell.lstr -e A fast, minimalist directory tree viewer, written in Rust
A fast, minimalist directory tree viewer, written in Rust. Inspired by the command line program tree, with a powerful interactive mode.

An interactive overview of a project's structure using lstr.
lstr for a classic tree-like view, or launch lstr interactive for a fully interactive TUI with keyboard and mouse navigation, filename search (/), and in-place file opening that returns to the tree when your editor exits.LS_COLORS environment variable for fully customizable file and directory colors.--icons (requires a Nerd Font).-p, including symlink and setuid/setgid/sticky indicators.-s, or cumulative directory sizes with --du.M, A, ?, etc.) with -G; directories reflect the status of their contents..gitignore files with the -g flag.-L) or show only directories (-d).--file-depth and --max-items.--output json), a self-contained HTML directory index (--output html), pipe-friendly text, and a Ctrl+s file-picker mode for shell integration.The easiest way to install lstr on macOS is with Homebrew.
brew install lstr
A community-maintained lstr-git package (thanks, @bakatrouble!) builds the latest commit from this repository. Install it with your preferred AUR helper, e.g.:
paru -S lstr-git
You need the Rust toolchain installed on your system to build lstr.
git clone https://github.com/bgreenwell/lstr.git
cd lstr
cargo install --path .
On NetBSD a package is available from the official repositories. To install it, simply run:
pkgin install lstr
lstr [OPTIONS] [PATH]
lstr interactive [OPTIONS] [PATH]
Note that PATH defaults to the current directory (.) if not specified.
| Option | Description |
|---|---|
-a, --all | List all files and directories, including hidden ones. |
--color | Specify when to use color output (always, auto, never). |
-d, --dirs-only | List directories only, ignoring all files. |
-g, --gitignore | Respect .gitignore and other standard ignore files. |
-G, --git-status | Show git status for files and directories. |
--icons | Display file-specific icons; requires a Nerd Font. |
--hyperlinks | Render file paths as clickable hyperlinks (classic mode only) |
-L, --level | Maximum depth to descend. |
--file-depth | Hide individual files below this depth, summarized as [+N files] (classic mode only). |
--max-items | Show at most N entries per directory, summarized as [+N more] (classic mode only). |
--du | Show directories with the cumulative size of their contents, like tree --du; implies -s (classic mode only). |
--output | Output format: text (default), json, or html (classic mode only). |
-p, --permissions | Display file permissions (Unix-like systems only). |
-s, --size | Display the size of files. |
Besides the default tree view, lstr can emit JSON for scripting or a
self-contained HTML directory index for browsing offline. Directories
render as collapsible `` elements and files as relative links, so
the page can be saved next to the tree it describes and opened directly in
a browser; -s, -p, and -G add size, permissions, and git-status
annotations, same as the other output formats. This is the live output of
lstr --output html -s assets on examples/sample-directory/assets
(GitHub strips the `
--sort | Sort entries by the specified criteria (name, size, modified, extension). |
--dirs-first | Sort directories before files. |
--case-sensitive | Use case-sensitive sorting. |
--natural-sort | Use natural/version sorting (e.g., file1 < file10). Takes precedence over --case-sensitive. |
-r, --reverse | Reverse the sort order. |
--dotfiles-first | Sort dotfiles and dotfolders first (dotfolders → folders → dotfiles → files). Implies --dirs-first. |
--expand-level | Interactive mode only: Initial depth to expand the interactive tree. |
--editor | Interactive mode only: Command used to open files, overriding $VISUAL/$EDITOR. |