Utility to display a tree view of directories.

Overview

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.

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

  1. Clone this repository or download the source code.

  2. Navigate to the src folder.

  3. Initialize the project with Cargo by running:

    cargo init
  4. 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:

  1. Place the treecraft binary in the directory where you want to generate a tree view.

  2. Open your terminal and navigate to the folder containing the treecraft binary:

    cd "filepath"
  3. Make the binary executable with the following command:

    chmod +x treecraft
  4. 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.

You might also like...
Semi-persistent, scoped test directories

Semi-persistent, scoped test directories This crate aims to make it easier to use temporary directories in tests, primarily by calling the testdir!()

Wraps cargo to move target directories to a central location [super experimental]

targo Wraps cargo to move target directories to a central location [super experimental] To use, cargo install --git https://github.com/sunshowers/targ

Temporary files and directories with UTF-8 paths.

camino-tempfile A secure, cross-platform, temporary file library for Rust with UTF-8 paths. This crate is a wrapper around tempfile that works with th

Bookmark directories for easy directory-hopping in the terminal
Bookmark directories for easy directory-hopping in the terminal

markd Bookmark directories for easy directory-hopping in the terminal. All it takes is one command markd to bookmark your current directory, or use th

Remove files or directories.

Wrm - Remove files or directories Installation Run the following Cargo command: cargo install wrm Usage To move files to trash($HOME/.local/share/wrm

A small command-line application to view images from the terminal written in Rust.
A small command-line application to view images from the terminal written in Rust.

A small command-line application to view images from the terminal written in Rust. It is basically the front-end of viuer

❗️ Small script to view GitHub notifications in the terminal
❗️ Small script to view GitHub notifications in the terminal

github-notifications Small script to view GitHub notifications in the terminal Shows and color-codes the notification source, eg if you're the owner o

A discord bot to view & monitor OpenSea collections, written in Rust

Titan What is this This is a discord bot to monitor OpenSea collections and get info about them, including: Floor Price Activity Sales per Hour And mo

View your github contribution calander in unicode.
View your github contribution calander in unicode.

View your github contribution calander in the terminal Now in rust! gh-cal 0.1.0 marshmallow View your github contribution calander in unicode USAGE:

Comments
  • Update to v0.2.0

    Update to v0.2.0

    This update brings several significant long-term changes:

    1. Introducing the OutputHandle struct for managing multiple output formats.
    2. Removing the println macro in favor of using write or writeln.
    3. Creating a meta folder for more efficient file metadata processing, with potential for future metadata extraction enhancements.
    4. Enhancing syntax.
    5. Improving file traversal and branch printing performance.
    opened by allaboutevemirolive 0
Releases(v.0.2.3)
  • v.0.2.3(Oct 16, 2023)

    What do these patches include?

    1. Use OsString instead of String to handle unicode on most operating systems.
    2. Directly use ANSI for better performance instead of relying on an external crate.
    3. Renamed files, folders, and variables to make our conventions and practices more consistent.
    4. You can now sort the list by the extension.
    Source code(tar.gz)
    Source code(zip)
    treecraft(4.54 MB)
  • v.0.2.1(Oct 5, 2023)

    Improve performance!

    1. treecraft (written in Rust):

    nemesis@nemesis:~/Documents/Github/Focus/util/treecraft/target/release$ time ./treecraft /home/nemesis/Documents/Github/Focus/lang go | wc 167987 975501 10678103

    real 0m0.690s user 0m0.423s sys 0m0.404s

    1. tree (written in C):

    nemesis@nemesis:~$ time tree /home/nemesis/Documents/Github/Focus/lang go | wc 172907 1086404 12634354

    real 0m1.126s user 0m0.912s sys 0m0.433s


    1. Current bencmark for treecraft (improper but still):

    Times Processing : 0.820742734s Total Directories : 12463 Total Files : 155517 Total Items : 167980 Total Size : 10.90 GB or 11700306893 bytes

    1. Current bencmark for tree (improper but still):

    10613 directories, 149968 files


    P/S: Do check the tree repository and other coreutils; currently, there are a lot of bugs related to memory.

    Source code(tar.gz)
    Source code(zip)
    treecraft(4.61 MB)
  • v.0.2.0(Oct 3, 2023)

    This update brings several significant long-term changes:

    1. Introducing the OutputHandle struct for managing multiple output formats.
    2. Removing the println macro in favor of using write or writeln.
    3. Creating a meta folder for more efficient file metadata processing, with potential for future metadata extraction enhancements.
    4. Enhancing syntax.
    5. Improving file traversal and branch printing performance.
    Source code(tar.gz)
    Source code(zip)
    treecraft(4.62 MB)
  • treecraft(Sep 28, 2023)

    Usage

    To use TreeCraft, follow these simple steps:

    1. Place the treecraft binary in the folder where you want to generate a tree view.

    2. Open your terminal and navigate to the folder where you put the treecraft binary with command cd "filepath".

    3. Run the following command to generate an ASCII tree-view on the terminal:

      ./treecraft "filepath"
      

      Replace "filepath" with the path to the target directory you want to visualize.

    Example 1: Generate a Text File

    To generate an ASCII tree-view and save it to a text file, use the -tf flag like this:

    ./treecraft /home/nemesis/Documents/Github/Focus/lang -tf
    

    This will create an output.txt file in the same folder as the target directory.

    Example 2: Terminal Tree-View

    To generate an ASCII tree-view directly on the terminal, use the following command:

    ./treecraft /home/nemesis/Documents/Github/Focus/lang
    

    TreeCraft will display the tree-view on your terminal screen, making it easy to explore your directory structure.

    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
    
    Source code(tar.gz)
    Source code(zip)
    treecraft(4.61 MB)
Owner
Akmal
Constantly iterating.
Akmal
Rust command line utility to quickly display useful secrets in a Kubernetes namespace

kube-secrets This is a command line utility for quickly looking at secrets in a Kubernetes namespace that are typically looked at by humans. It specif

Frank Wiles 8 Feb 10, 2022
Count your code by tokens, types of syntax tree nodes, and patterns in the syntax tree. A tokei/scc/cloc alternative.

tcount (pronounced "tee-count") Count your code by tokens, types of syntax tree nodes, and patterns in the syntax tree. Quick Start Simply run tcount

Adam P. Regasz-Rethy 48 Dec 7, 2022
Traversal of tree-sitter Trees and any arbitrary tree with a TreeCursor-like interface

tree-sitter-traversal Traversal of tree-sitter Trees and any arbitrary tree with a TreeCursor-like interface. Using cursors, iteration over the tree c

Sebastian Mendez 12 Jan 8, 2023
As-tree - Print a list of paths as a tree of paths 🌳

as-tree Print a list of paths as a tree of paths. For example, given: dir1/foo.txt dir1/bar.txt dir2/qux.txt it will print: . ├── dir1 │ ├── foo.tx

Jake Zimmerman 396 Dec 10, 2022
A cli tool to download specific GitHub directories or files

cloneit A cli tool to download specific GitHub directories or files. Installation From git git clone https://github.com/alok8bb/cloneit cd cloneit car

Alok 54 Dec 20, 2022
Voila is a domain-specific language launched through CLI tool for operating with files and directories in massive amounts in a fast & reliable way.

Voila is a domain-specific language designed for doing complex operations to folders & files. It is based on a CLI tool, although you can write your V

Guillem Jara 86 Dec 12, 2022
RnR is a command-line tool to securely rename multiple files and directories that supports regular expressions

RnR is a command-line tool to securely rename multiple files and directories that supports regular expressions. Features Batch rename files and direct

Ismael González Valverde 219 Dec 31, 2022
Find and clean heavy build or cache directories.

ProjClean Find and clean heavy build or cache directories. ProjClean finds directories such as node_modules(node), target(rust), build(java) and their

null 42 Sep 25, 2022
Tool for managing dotfiles directories; Heavily based on rcm.

Paro paro : to prepare, get ready / set, put / furnish, supply. Tool for managing dotfiles directories; Heavily based on rcm. TODO Rust Boilerplate CI

Rafael Delboni 7 Nov 20, 2022
Quickly find all blackhole directories with a huge amount of filesystem entries in a flat structure

findlargedir About Findlargedir is a tool specifically written to help quickly identify "black hole" directories on an any filesystem having more than

Dinko Korunic 24 Jan 1, 2023