{"by":"w108bmg","descendants":66,"id":44306041,"kids":[44306152,44306230,44306405,44310484,44306379,44313764,44307434,44307473,44306096,44306877,44310388,44306694],"score":227,"text":"Hi HN,<p>(First time poster!)<p>I&#x27;m the author of `lstr`. I&#x27;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\\!<p>Here&#x27;s a quick look at the interactive mode:<p><a href=\"https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;bgreenwell&#x2F;lstr&#x2F;main&#x2F;assets&#x2F;lstr-demo.gif\" rel=\"nofollow\">https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;bgreenwell&#x2F;lstr&#x2F;main&#x2F;asset...</a><p>I&#x27;ve just released v0.2.0 with some features I think this community might find useful:<p><pre><code>  * **Interactive TUI Mode:** You can launch it with `lstr interactive`. It allows for keyboard-driven navigation, expanding&#x2F;collapsing directories, and opening files in your default editor.\n  * **Git Status Integration:** Using the `-G` flag, `lstr` will show the Git status of every file and directory right in the tree output.\n  * **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`&#x2F;`.zshrc`:\n    ```bash\n    lcd() {\n        local selected_path\n        selected_path=&quot;$(lstr interactive -gG)&quot;\n        if [[ -n &quot;$selected_path&quot; &amp;&amp; -d &quot;$selected_path&quot; ]]; then\n            cd &quot;$selected_path&quot;\n        fi\n    }\n    ```\n    Then just run `lcd` to visually pick a directory and jump to it.\n</code></pre>\nIt also supports file-type icons (via Nerd Fonts), file sizes, permissions, and respects your `.gitignore`.<p>The project is open-source and I would love to get your feedback.<p>GitHub: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;bgreenwell&#x2F;lstr\">https:&#x2F;&#x2F;github.com&#x2F;bgreenwell&#x2F;lstr</a><p>Crates.io: <a href=\"https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;lstr\" rel=\"nofollow\">https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;lstr</a><p>Thanks for checking it out!","time":1750212439,"title":"Show HN: Lstr – A modern, interactive tree command written in Rust","type":"story","url":"https://github.com/bgreenwell/lstr"}