TreeCraft v0.2.3 (16 October 2023)
TreeCraft is a command-line utility written in pure Rust that helps you visualize directory structures in ASCII format on your terminal or save them to a text file.
Command Line Options
TreeCraft offers several command line options:
-tf
: Output the tree view to a text file.-ci
: Sort filenames with case insensitivity or lowercase.-cs
: Sort filenames.-no
: Do not sort.-xt
: Sort based on file's extension.-help
: Display usage information and exit.
Recommended Usage
1. Compile with cargo build --release
(Recommended)
To ensure optimal performance, compile TreeCraft with the following command, which generates highly efficient code tailored to your platform:
cargo build --release
2. Usage from Source Code
-
Clone this repository or download the source code.
-
Navigate to the
src
folder. -
Initialize the project with Cargo by running:
cargo init
-
Generate an ASCII tree view with the following command:
cargo run "filepath" "flag"
For example:
cargo run /home/nemesis/Documents/Github/Focus/lang -tf
3. Usage of the treecraft
Binary
Download the treecraft binary and follow these steps:
-
Place the
treecraft
binary in the directory where you want to generate a tree view. -
Open your terminal and navigate to the folder containing the
treecraft
binary:cd "filepath"
-
Make the binary executable with the following command:
chmod +x treecraft
-
Generate an ASCII tree view in the terminal by running:
./treecraft "filepath"
Replace
"filepath"
with the path to the directory you want to visualize.
Examples of TreeCraft Usage
Here are two examples of how to use TreeCraft to visualize directory structures:
Example 1: Generate a Text File
To create an ASCII tree-view and save it to a text file, utilize the -tf
flag like this:
./treecraft /home/nemesis/Documents/Github/Focus/lang -tf
This will generate an output.txt
file in the same directory as your specified target folder.
Example 2: Terminal Tree-View
For an ASCII tree-view directly on the terminal, use this command:
./treecraft /home/nemesis/Documents/Github/Focus/lang
TreeCraft will then display the tree-view on your terminal screen, allowing you to conveniently explore your directory structure.
Example Output:
│ │ │ └── main.zig
│ │ ├── windows_spawn
│ │ │ ├── build.zig
│ │ │ ├── hello.zig
│ │ │ └── main.zig
│ │ └── zerolength_check
│ │ ├── build.zig
│ │ └── src
│ │ └── main.zig
│ ├── standalone.zig
│ ├── tests.zig
│ └── translate_c.zig
└── tools
├── crc
│ └── catalog.txt
Licensing
TreeCraft is released under the MIT License. You are free to use, modify, and distribute this software in accordance with the terms of the license.