Skip to content

OussamaM1/treels

Repository files navigation

treels

Go codecov

treels is a Go CLI that blends the quick scan of ls with the structure of tree. Use it to inspect directories as a compact grid, expand them as a tree, hide project noise with .gitignore, show detailed metadata, and keep large repositories readable with depth limits.

treels preview

Table of contents

Quick start

treels                         # compact ls-style view
treels --tree                  # recursive tree view
treels --tree --depth 2        # tree view limited to two levels
treels --tree --gitignore      # exclude root .gitignore matches
treels --tree --dirs-only      # show directory structure only
treels --long --readable       # detailed listing with readable sizes
treels --include "*.go"         # show only matching files
treels --exclude "*.log"        # hide matching files
treels --git-status            # show Git state next to entries
treels --sort size --reverse   # sort entries by largest first
treels --dirs-first            # group directories before files
treels --json                  # machine-readable output
treels --no-icons              # fallback for terminals without Nerd Fonts

Note

File and folder icons look best with a Nerd Font installed. If your terminal does not support Nerd Font glyphs, use --no-icons.

Installation

With Go

go install github.com/oussamaM1/treels@latest

Make sure your Go binary directory is in your PATH. You can check where Go installs binaries with:

go env GOPATH

The binary is usually placed in:

$(go env GOPATH)/bin

From source

git clone https://github.com/OussamaM1/treels.git
cd treels
go build .
./treels --version

Features

Feature Flag
Compact grid listing default
Recursive tree view -t, --tree
Depth limit --depth N
Detailed metadata -l, --long
Human-readable sizes -r, --readable
Include/exclude filters --include PATTERN, --exclude PATTERN
Git status decorations --git-status
Sorting `--sort name
JSON output --json
Hidden files -a, --all
Directory-only view --dirs-only
Respect root .gitignore --gitignore
Disable icons --no-icons
Hide text summary --no-summary
Version output -v, --version

Usage

treels [flags] [path]

If no path is provided, treels lists the current directory.

For detailed usage examples and flag interactions, see docs/usage.md.

Preview

Examples below use --no-icons so output is readable in any terminal.

Compact directory listing

$ treels --no-icons file-icons-example
.
Dockerfile               Main.kt                  Program.cs
app.conf                 app.lock                 app.log
app.rb                   app.swift                backup.zip
c-file.c                 class-java-file.class    component.vue
config.xml               cpp-file.cpp             document.pdf
index.html               index.php                java-file.java
javascript-file.js       json-file.json           logo.png
main.tf                  package.json             plb-file.plb
pls-file.pls             python-file.py           react-component.jsx
react-typescript.tsx     rust-file.rs             script.sh
song.mp3                 sql-file.sql             styles.css
typescript-file.ts       video.mp4                yaml-file.yml

0 directories, 36 files

Tree view with a depth limit

$ treels --tree --depth 1 --gitignore --no-icons
.
├── LICENSE
├── README.md
├── cmd
├── docs
├── example
├── file-icons-example
├── go.mod
├── go.sum
├── main.go
├── module
├── service
└── utils

7 directories, 5 files

Detailed listing

$ treels --long --readable --no-icons service
.
-rw-r--r--      3.8 KB  2026-06-10  gitignore.go
-rw-r--r--      4.0 KB  2026-06-10  json.go
-rw-r--r--      7.1 KB  2026-06-10  service.go
-rw-r--r--     35.0 KB  2026-06-10  service_test.go
-rw-r--r--     18.0 KB  2026-06-10  util.go

0 directories, 5 files

Documentation

Development

go test ./...
go vet ./...
golangci-lint run
go build .

See docs/development.md for more details.

License

This project is licensed under the terms in LICENSE.

About

⚡ Treels is a CLI tool crafted in Go, merging tree and ls commands with intuitive merging and beautification features.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages