This project is licensed under the Mozilla Public License, v. 2.0. See the LICENSE file for details.
SPDX-License-Identifier: CC-BY-SA-4.0
The Problem: Standard tree commands output thousands of lines for modern projects:
- Rust projects: target/ directories with 50,000+ files
- Node.js projects: node_modules/ with endless dependencies
- Build artifacts cluttering your tree view
- Difficulty finding specific file types
- No easy way to filter by permissions or file attributes
The Solution: Tree Navigator gives you surgical control: - π― Smart Filtering: Exclude directories/files by name or pattern - π Type Selection: Show only executables, configs, scripts, or data files - π Statistics: Get file counts, sizes, and exclusion metrics - πΎ Clean Export: Save filtered trees to files for documentation - π‘οΈ Robust: Handle permission errors gracefully - β‘ Fast: Compile-time optimizations via Ada
-
π― Advanced Filtering - Exclude specific directories and file patterns
-
π Type-Based Selection - Filter by file type (executable, config, script, data, etc.)
-
π Statistics - Automatic counting of files, directories, and total size
-
πΎ File Export - Save tree output to files for documentation or analysis
-
π Hidden File Control - Show or hide dotfiles
-
π Depth Limiting - Control how deep to traverse
-
π¦ Size Display - Optional file size information
-
π¨ Color-Coded - Visual distinction with emoji icons
-
π‘οΈ Permission Handling - Graceful handling of access denied errors
-
π Interactive Mode - Navigate and bookmark favorite locations
Tree Navigator automatically categorizes files:
- π Directories
- βοΈ Executables (.exe, .bin, executable permission)
- βοΈ System Configs (.conf, .cfg)
- π Shell Scripts (.sh, .bash)
- π Data Files (.json, .xml, .yaml, .yml)
- π» Hidden Files (starting with .)
- π Regular Files (everything else)
Export directory trees to files with powerful filtering:
= Basic export
tree-navigator --export output.txt
= Export with depth limit
tree-navigator --export output.txt --max-depth 5
= Export specific directory
tree-navigator --export output.txt --dir /path/to/project
= Show file sizes
tree-navigator --export output.txt --show-sizePerfect for ignoring build artifacts and dependencies:
= Rust project - exclude build directory
tree-navigator --export rust-tree.txt --exclude-dirs target
= Node.js - exclude dependencies
tree-navigator --export node-tree.txt --exclude-dirs node_modules
= Multiple exclusions
tree-navigator --export clean-tree.txt --exclude-dirs "target,node_modules,.git,build,dist"
= Ada/GNAT project
tree-navigator --export ada-tree.txt --exclude-dirs obj,binFilter out specific files or patterns:
= Exclude compiled objects
tree-navigator --export source-tree.txt --exclude-files "*.o,*.ali,*.so"
= Exclude temporary files
tree-navigator --export clean-tree.txt --exclude-files "*.tmp,*.log,*.bak,*~"
= Exclude multiple patterns
tree-navigator --export code-tree.txt --exclude-files "*.o,*.exe,*.dll,*.pyc"Show only specific categories of files:
= Only executables
tree-navigator --export bins.txt --only-type executable
= Only configuration files
tree-navigator --export configs.txt --only-type config
= Only shell scripts
tree-navigator --export scripts.txt --only-type script
= Only data files (JSON, XML, YAML)
tree-navigator --export data.txt --only-type data
= Only directories (no files)
tree-navigator --export dirs.txt --no-files
= Only files (no subdirectories)
tree-navigator --export files.txt --no-dirsHidden Files
= Include hidden files
tree-navigator --export full-tree.txt --show-hidden
= Show only hidden files
tree-navigator --export hidden-tree.txt --only-type hidden= Clean tree for README, excluding build artifacts
tree-navigator --export project-structure.txt \
--exclude-dirs "target,.git" \
--exclude-files "*.lock,*.toml" \
--max-depth 4= Show project structure without dependencies
tree-navigator --export app-structure.txt \
--exclude-dirs "node_modules,dist,.next,coverage" \
--exclude-files "*.map,*.log" \
--max-depth 5= Locate all binary files in a project
tree-navigator --export executables.txt \
--only-type executable \
--show-size= List all config files for review
tree-navigator --export all-configs.txt \
--only-type config \
--show-hiddenNavigate directories interactively with depth control:
= Start interactive mode
tree-navigator
= Start with depth limit
tree-navigator 5
= Or
tree-navigator --depth 10Interactive Commands:
- [dirname] - Enter a directory
- [..] - Go up one level
- [/] - Jump to root
- [~] - Go to home
- [b] - Show bookmarks
- [+] - Add bookmark
- [q] - Quit
-h, --help Show help message
-v, --version Show version information
--no-color Disable colored output
--verbose Enable verbose output--export FILE Export tree to file (enables export mode)
--output FILE Alternative way to specify output file
--dir PATH Root directory to export (default: current)--max-depth N Maximum depth to traverse (default: 10)
--show-hidden Include hidden files (starting with .)
--no-files Only show directories
--no-dirs Only show files
--show-size Display file sizes
--exclude-dirs LIST Comma-separated list of directories to exclude
--exclude-files LIST Comma-separated list of files/patterns to exclude
--only-type TYPE Only show specific file type
Types: directory, executable, config, script,
data, hidden, regularExample output:
Directory tree: /home/user/project
Generated: 2024-11-06 10:30:45
Max depth: 5
================================================================================
π project
βββ π src
β βββ π main.adb
β βββ π config.ads
β βββ π navigator.adb
βββ π bin
β βββ βοΈ tree-navigator
βββ βοΈ Makefile
βββ π README.md
================================================================================
Statistics:
Directories: 2
Files: 5
Total size: 45231 bytes
Excluded dirs: 1tree-navigator/
βββ src/
β βββ main.adb # CLI argument parsing & main logic
β βββ navigator.ads/adb # Interactive navigation
β βββ tree_printer.ads/adb # Tree export engine
β βββ bookmarks.ads/adb # Bookmark management
β βββ config.ads/adb # Configuration
β βββ terminal.ads/adb # Terminal I/O
β βββ file_types.ads/adb # File categorization
βββ bin/ # Compiled executable
βββ obj/ # Build artifacts
βββ tree_navigator.gpr # GNAT project file
βββ Makefile # Build automation
βββ README.md # This file
βββ LICENSE # Palimpsest-MPL-1.0 License
βββ CONTRIBUTING.md # Contribution guidelines
βββ CHANGELOG.md # Version history= Clean build
gprclean -P tree_navigator.gpr
gprbuild -P tree_navigator.gpr
= Using Make
make clean
make build
= Run
./bin/main --helpTree Navigator stores data in:
- Config: ~/.config/tree-navigator/
- Bookmarks: ~/.config/tree-navigator/bookmarks.txt
- Cache: ~/.cache/tree-navigator/
-
Ada Community - Excellent language and tools
-
GNAT - World-class Ada compiler
-
Contributors - See [CONTRIBUTORS.md](CONTRIBUTORS.md)
-
[Ada 2022 Reference](http://www.ada-auth.org/standards/22rm/html/RM-TOC.html)
-
[GNAT Userβs Guide](https://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ugn.html)
-
[Ada Programming](https://en.wikibooks.org/wiki/Ada_Programming)
Found a bug or have a feature request? [Open an issue](https://github.com/yourusername/tree-navigator/issues)!
Built with Ada 2022 | Solving real problems with compile-time guarantees
See TOPOLOGY.md for a visual architecture map and completion dashboard.