# lstr: A Fast, Minimalist Directory Tree Viewer Written in Rust

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/bgreenwell-lstr
Generated for open source discovery and AI-assisted research.

lstr is a high-performance, minimalist command-line utility for viewing directory trees, built with Rust. It offers both a classic `tree`-like output and a powerful interactive Text User Interface (TUI) mode for fluid exploration. With features like Git integration, icon support, and smart filtering, lstr provides an efficient way to understand project structures.

GitHub: https://github.com/bgreenwell/lstr
OSRepos URL: https://osrepos.com/repo/bgreenwell-lstr

## Summary

lstr is a high-performance, minimalist command-line utility for viewing directory trees, built with Rust. It offers both a classic `tree`-like output and a powerful interactive Text User Interface (TUI) mode for fluid exploration. With features like Git integration, icon support, and smart filtering, lstr provides an efficient way to understand project structures.

## Topics

- cli
- rust
- directory-viewer
- tree-command
- developer-tools
- filesystem
- tui
- command-line

## Repository Information

Last analyzed by OSRepos: Fri Feb 27 2026 17:40:11 GMT+0000 (Western European Standard Time)
Detail views: 4
GitHub clicks: 2

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction

lstr is a modern, fast, and minimalist directory tree viewer written in Rust. Inspired by the classic `tree` command, lstr enhances the experience with a powerful interactive mode and a focus on performance. It's designed to provide essential features without bloat, making it an ideal tool for developers and anyone needing to quickly visualize file system structures.

Key features include:

*   **Classic and Interactive Modes:** Choose between a traditional `tree`-like output or a fully interactive TUI for keyboard-driven exploration.
*   **Theme-aware Coloring:** Respects your system's `LS_COLORS` environment variable for customizable file and directory colors.
*   **Rich Information Display:** Optionally show file-specific icons (requires a Nerd Font), permissions, sizes, and Git statuses.
*   **Smart Filtering:** Integrates with `.gitignore` files and allows control over recursion depth.

## Installation

Installing lstr is straightforward across various platforms.

### With Homebrew (macOS)

For macOS users, Homebrew provides the easiest installation method:

zsh
brew install lstr


### From Source (All Platforms)

If you have the Rust toolchain installed, you can build and install lstr from its source code:

1.  **Clone the repository:**
    bash
git clone https://github.com/bgreenwell/lstr.git
cd lstr
    
2.  **Build and install using Cargo:**
    bash
cargo install --path .
    

### NetBSD

NetBSD users can install lstr directly from official repositories:

bash
pkgin install lstr


## Examples

Here are a few examples demonstrating lstr's versatility:

**1. Explore a project interactively, ignoring gitignored files and showing icons:**

bash
lstr interactive -g --icons


**2. Display a directory with file sizes and permissions in classic view:**

bash
lstr -sp


**3. See the Git status of all files in a project:**

bash
lstr -aG


**4. Get a tree with clickable file links (in a supported terminal):**

bash
lstr --hyperlinks


**5. Sort files naturally with directories first:**

bash
lstr --dirs-first --natural-sort


## Why Use lstr?

lstr offers several compelling reasons to integrate it into your workflow:

*   **Performance:** Written in Rust, lstr is inherently fast and efficient, handling large directories with ease.
*   **Interactivity:** The optional TUI mode provides a dynamic, keyboard-driven way to navigate and explore your file system, a significant upgrade from static `tree` output.
*   **Developer-Friendly:** Features like Git status integration, `.gitignore` support, and customizable output make it an invaluable tool for managing codebases.
*   **Customization:** Full support for `LS_COLORS` ensures that lstr integrates seamlessly with your existing terminal theme and preferences.
*   **Minimalist Design:** It focuses on core functionality without unnecessary complexity, providing a clean and uncluttered user experience.

## Links

*   **GitHub Repository:** [https://github.com/bgreenwell/lstr](https://github.com/bgreenwell/lstr "lstr GitHub Repository" target="_blank")
*   **Crates.io:** [https://crates.io/crates/lstr](https://crates.io/crates/lstr "lstr on Crates.io" target="_blank")