UPDATE: TREECRAFT CURRENTLY IN FREEZE SHIPPING AND WILL BE GOING RAPID DEVELOPMENT AND BREAKING CHANGES.
TreeCraft is a command-line tool developed in pure Rust, designed for displaying directory structures in ASCII format on the terminal or saving them to a text file. It serves as a seamless replacement for the tree utility written in C. The primary goal of this project is to provide a non-bloated and more functional alternative to the existing tree.
What to anticipate:
- A direct replacement for tree.
- Swift and efficient performance across various platforms.
- Respect for
.gitignore
rules and graceful handling of hidden files (planned). - A minimalist design that is more functional compared to the current tree.
What not to expect:
- No integration of other existing GNU utilities, as they are already well-suited for their respective purposes and do not align with the goals of this project. Example output:
$ tc
release
.
├── build
├── deps
│ ├── treecraft-52fb4a3e910503fe
│ └── treecraft-52fb4a3e910503fe.d
├── examples
├── incremental
└── treecraft.d
Insights:
.
├── Processing Time : 0.00037471 seconds
├── Visible Dirs : 4
├── Visible Files : 3
├── *Hidden Dirs/Files : 2
├── Total Items(excl.*) : 7
└── Total Size : 0.00 GB (4,809,968 bytes)
TreeCraft offers several command line options:
Usage: tc [OPTIONS]
Options:
-d, --default Print default layout. Etc. GNU tree's layout
-s, --case-sensitive Sort list in case-sensitive
-f, --file Printout output in a text file
-h, --help Print help
Compile TreeCraft with the following command, which generates highly efficient code tailored to your platform:
cargo build --release
-
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
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 tc
-
Generate an ASCII tree view in the terminal by running:
./tc "filepath"
Replace
"filepath"
with the path to the directory you want to visualize.
-
Open your
.bashrc
file for editing by running this command:nano ~/.bashrc
-
Go to the end of the file and add the following line, replacing the placeholders with your actual information:
alias tr="/path/to/your/project/target/release/your_binary_name"
- Replace "/path/to/your/project" with the actual path to your project directory.
- Replace "your_binary_name" with the name of your Rust binary.
-
Save your changes and exit the text editor (in nano, press Ctrl+O to save and Ctrl+X to exit).
-
Apply the changes to your current terminal session by running:
source ~/.bashrc
See CONTRIBUTING.md.
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.