Show HN: Lstr – A modern, interactive tree command written in Rust

Hi HN,

(First time poster!)

I'm the author of `lstr`. I've always loved the classic Linux `tree` command for its simplicity, but I often found myself wanting more modern features like interactivity and Git integration. So, I decided to build my own version in Rust with a philosophy of being fast, minimalist, and interactive. It was also an excuse to help learn more about Rust\!

Here's a quick look at the interactive mode:

https://raw.githubusercontent.com/bgreenwell/lstr/main/asset...

I've just released v0.2.0 with some features I think this community might find useful:

  * **Interactive TUI Mode:** You can launch it with `lstr interactive`. It allows for keyboard-driven navigation, expanding/collapsing directories, and opening files in your default editor.
  * **Git Status Integration:** Using the `-G` flag, `lstr` will show the Git status of every file and directory right in the tree output.
  * **Shell Integration:** This is my favorite feature. In interactive mode, you can press `Ctrl+s` to quit and have `lstr` print the selected path to stdout. This lets you pipe it into other commands or use it as a visual `cd`. For example, you can add this function to your `.bashrc`/`.zshrc`:
    ```bash
    lcd() {
        local selected_path
        selected_path="$(lstr interactive -gG)"
        if [[ -n "$selected_path" && -d "$selected_path" ]]; then
            cd "$selected_path"
        fi
    }
    ```
    Then just run `lcd` to visually pick a directory and jump to it.
It also supports file-type icons (via Nerd Fonts), file sizes, permissions, and respects your `.gitignore`.

The project is open-source and I would love to get your feedback.

GitHub: https://github.com/bgreenwell/lstr

Crates.io: https://crates.io/crates/lstr

Thanks for checking it out!


Comments URL: https://news.ycombinator.com/item?id=44306041

Points: 52

# Comments: 22

https://github.com/bgreenwell/lstr

созданный 4h | 18 июн. 2025 г., 04:20:06


Войдите, чтобы добавить комментарий