TreeGo is a fast, concurrent, and safe directory tree printer and file search tool written in Go. It allows you to print the directory structure, search for files, and filter results using regex patterns or directories-only mode.
- Print a visual directory tree.
- Search for files and directories by name.
- Filter files and directories using regex.
- Option to display directories only.
- Safe concurrent traversal with automatic error handling.
- Exits immediately if an error or deadlock is detected.
- Ensure you have Go installed (1.20+ recommended).
- Clone the repository:
git clone https://github.com/marcuwynu23/treego.git
cd treego- Build the binary:
go build -o treego main.go- Run the tool:
./treego <path> [--search <query>] [--regex <pattern>] [--dirs-only]treego <path> [--search <query>] [--regex <pattern>] [--dirs-only] [--version]
--search,-s: Search string. Prints full path of matching files.--regex,-r: Regex filter to match file or directory names.--dirs-only,-d: Show only directories.--version: Show TreeGo version.
Print the tree of a folder:
treego /path/to/projectSearch for files containing main:
treego /path/to/project --search mainShow directories only:
treego /path/to/project --dirs-onlyUse regex to filter names:
treego /path/to/project --regex "\.go$"- Uses a global abort channel to exit immediately on errors.
- Prevents deadlocks when traversing large directories.
- Concurrent processing of directories for faster traversal.