Skip to content

marcuwynu23/treego

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TreeGo

Stars Badge Forks Badge Issues Badge License Badge

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.


Features

  • 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.

Installation

  1. Ensure you have Go installed (1.20+ recommended).
  2. Clone the repository:
git clone https://github.com/marcuwynu23/treego.git
cd treego
  1. Build the binary:
go build -o treego main.go
  1. Run the tool:
./treego <path> [--search <query>] [--regex <pattern>] [--dirs-only]

Usage

treego <path> [--search <query>] [--regex <pattern>] [--dirs-only] [--version]

Flags

  • --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.

Examples

Print the tree of a folder:

treego /path/to/project

Search for files containing main:

treego /path/to/project --search main

Show directories only:

treego /path/to/project --dirs-only

Use regex to filter names:

treego /path/to/project --regex "\.go$"

Safety Features

  • Uses a global abort channel to exit immediately on errors.
  • Prevents deadlocks when traversing large directories.
  • Concurrent processing of directories for faster traversal.

About

TreeGo is a cli tool for printing directory structures and searching files.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages