Skip to content

A sleek and fast directory visualizer for your terminal

License

Notifications You must be signed in to change notification settings

mattialoszach/appletree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

appletree - A Simple Directory Tree Viewer 🍏🌳✨

'appletree' is a lightweight and efficient terminal-based directory tree viewer for macOS & Linux.
It helps you visualize folder structures with optional file filtering.

appletree Screenshot

appletree Screenshot

appletree Screenshot

📌 Features

  • 📂 Display a tree-like structure of directories and files
  • ❌ Exclude specific files or folders (-e)
  • ✅ Show only selected files or folders (-o)
  • 📏 Limit recursion depth (-d)
  • 🎨 Choose a theme (-t classic or -t round)
  • 📦 Show file & directory sizes (-s)
  • 🔧 Designed for macOS & Linux
  • ⚡ Fast and lightweight

📦 Installation

Download the Repository

Clone the repository to your local machine:

git clone https://github.com/mattialosz/appletree.git
cd appletree

Simple Installation using Makefile

  • You can compile and install appletree locally using the provided Makefile:
make
sudo make install

The binary will be installed to /usr/local/bin/appletree by default

  • To remove:
sudo make uninstall

Further options:

To run without installing:

make run

Just create a binary:

make

Compiling from Source

If you prefer to compile the source code yourself, go to the folder and run:

g++ -std=c++17 -o appletree main.cpp

Now, you have an executable appletree that you can run.

If you are using older versions of the GCC compiler and encounter error messages related to the implementation of std::filesystem you can tell the linker about the right library by just adding a flag:

g++ -std=c++17 -o appletree main.cpp -lstdc++fs

🚀 Making Appletree Globally Accessible

Local Execution

If you prefer to run appletree only in the current directory, simply navigate to its location and execute:

./appletree

Global Installation (Recommended)

To make appletree available as a system-wide command, move it to /usr/local/bin/:

sudo mv appletree /usr/local/bin/
sudo chmod +x /usr/local/bin/appletree

Now, you can run appletree from anywhere by simply typing:

appletree

📖 Usage

  • Simply open a terminal and run:
appletree
  • Exclude Specific Files/Folders (example)
appletree -e node_modules

(This will exclude the node_modules folder from the output.)

  • Exclude Hidden Files/Folders
appletree -e .

(This will automatically exclude all hidden files/folders from the output.)

  • Show Only Selected Files/Folders (example)
appletree -o src include

(This will display only the src and include directories.)

  • Limit Tree/Recursion Depth
appletree -d 2

(This will display only the first two levels of the tree.)

  • Show File & Directory Sizes
appletree -s

(Shows the size of each file and the total recursive size of each directory)

  • Display Help
appletree help

(Shows detailed usage instructions.)


You can change how the tree looks with the -t flag. Available options:

  • classic (default)
  • round

Change Theme/Format

appletree -t round

⚡ Pro Tip: Aliases for faster workflow

For maximum efficiency, you can add an alias to your shell config (.zshrc, .bashrc, etc.). This way you don’t have to type long commands every time.

Example (zsh):

alias atr="appletree -e . __pycache__ -t round"

Now you can simply type:

atr

…and instantly get your customized tree view 🚀

📜 Example Output

 my_project
 ├── src
 │   ├── main.cpp
 │   ├── utils.h
 │   └── utils.cpp
 ├── include
 │   └── config.h
 ├── README.md
 └── Makefile

🚀 Contribute

Feel free to fork the repo, open issues, or submit pull requests! Contributions are always welcome.

⚠️ Updates

  • This is the first version
  • Updates/optimizations will follow soon

Releases

No releases published

Packages

No packages published