v0.4.2 • Rust • Built with 🦀

A tree alternative

Stop drowning in dependency folders. Struct shows your project's actual structure while intelligently hiding the noise you don't care about.

bash — struct
# Before: tree command - chaos
$ tree -L 3
venv/
├── lib/
│ ├── python3.11/
│ │ ├── site-packages/
│ │ │ ├── pip/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── ... (2000+ files you didn't ask for)
# After: struct
$ struct 3
venv/ (2741 files ignored)
src/
├── main.rs
└── lib.rs

Why Struct?

Built by developers, for developers. No more scrolling through endless dependency folders.

Signal over noise

Automatically hides venv, node_modules, .git, and 20+ other noise directories while showing you the file count.

Intelligent defaults

Knows about Python, JavaScript, Rust, and more. No configuration needed to get started.

Directory summaries

struct 0 gives you detailed stats: file counts, sizes, types, and what's being ignored.

Built-in search

Find files across your project with struct search "*.py". Tree or flat output modes.

Comprehensive Git Integration

Multiple git modes: tracked (-g), untracked (--gu), staged (--gs), modified (--gc). Color-coded output with branch display.

Blazing fast

Written in Rust for performance. Scan thousands of files in milliseconds, not seconds.

Everything you need,
nothing you don't

Struct is designed to be powerful yet intuitive. Here are the features that make it stand out:

Depth Control

Infinite depth by default, or limit with struct 3

Git Integration

Track (-g), staged (--gs), modified (--gc), untracked (--gu) with color-coding

Size Awareness

Show file sizes with -z or skip large folders with -s 100

Custom Ignores

Add permanent ignore patterns with struct add "pattern"

Flexible Output

Tree view or flat list with full paths for easy grep/scripting

Usage Examples
# Show current directory structure
$ struct
# Show 3 levels deep with sizes
$ struct 3 -z
# Git-tracked files only
$ struct 2 -g
# Show staged files with green color
$ struct 3 --gs --gr
# Search for Python files & folders
$ struct search "*.py" -f
# Summary mode with stats
$ struct 0
Auto-ignored Directories 20+ patterns
venv, .venv, env node_modules __pycache__, .pytest_cache target, build, dist .git, .svn, .hg .vscode, .idea .next, .nuxt *.pyc, *.pyo

Installation

Get started in seconds. Struct is lightweight and dependency-free.

Option 1: Install from crates.io
The easiest way is to install directly via Cargo (make sure you have Rust installed):
$ cargo install struct-cli
View on crates.io
Option 2: Install from source
$ git clone https://github.com/caffienerd/struct-cli.git
$ cd struct-cli
$ chmod +x install.sh && ./install.sh
Works on RHEL, Arch, Ubuntu, Debian, Fedora, and other Linux distributions

Quick Start

# Show everything (infinite depth)
struct
# Show 3 levels deep
struct 3
# Summary of current directory
struct 0

Open Source

Struct is MIT licensed and open source. Found a bug? Want a feature? Contributions are welcome.

MIT License • Built with Rust