{"id":49295334,"url":"https://github.com/caffienerd/struct-cli","last_synced_at":"2026-04-26T03:08:43.367Z","repository":{"id":338240890,"uuid":"1157128771","full_name":"caffienerd/struct-cli","owner":"caffienerd","description":"struct is a smarter tree command built in Rust, focused on presenting clean, meaningful project structure instead of drowning users in dependency directories, build artifacts, and cache clutter. With intelligent ignore defaults, configurable filtering, git-aware views, file size insights, and pattern-based search and struct prioritizes clarity.","archived":false,"fork":false,"pushed_at":"2026-02-24T10:53:04.000Z","size":121,"stargazers_count":33,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-15T15:06:38.901Z","etag":null,"topics":["cli","developer-tools","filesystem","git","linux","open-source","rust","terminal","terminal-based","tree","tree-command","utilities"],"latest_commit_sha":null,"homepage":"https://caffienerd.github.io/struct-cli/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caffienerd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-13T13:15:40.000Z","updated_at":"2026-03-25T13:24:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/caffienerd/struct-cli","commit_stats":null,"previous_names":["caffienerd/struct-cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/caffienerd/struct-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caffienerd%2Fstruct-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caffienerd%2Fstruct-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caffienerd%2Fstruct-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caffienerd%2Fstruct-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caffienerd","download_url":"https://codeload.github.com/caffienerd/struct-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caffienerd%2Fstruct-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32284360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"online","status_checked_at":"2026-04-26T02:00:05.962Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","developer-tools","filesystem","git","linux","open-source","rust","terminal","terminal-based","tree","tree-command","utilities"],"created_at":"2026-04-26T03:08:42.926Z","updated_at":"2026-04-26T03:08:43.362Z","avatar_url":"https://github.com/caffienerd.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# struct\n\nStruct: tree with a developer brain.\nStop drowning in site-packages — struct shows you the code you care about.\n\n## The Problem\n\nRunning `tree` in a project directory gives you this:\n\n```bash\n$ tree -L 3\nvenv/\n├── lib/\n│   ├── python3.11/\n│   │   ├── site-packages/\n│   │   │   ├── pip/\n│   │   │   │   ├── __init__.py\n│   │   │   │   ├── ... (2000+ files you didn't ask for)\n```\n\nI needed something that shows project structure without drowning me in dependency folders.\n\n## What This Does\n\n`struct` shows your project's actual structure while automatically hiding the noise:\n\n```bash\n$ struct 3\nvenv/ (2741 files ignored)\nsrc/\n├── main.rs\n└── lib.rs\n```\n\nThe folder still appears, but you get a clean file count instead of thousands of irrelevant paths.\n\n## Installation\n\n### Option 1: Install from crates.io\n```bash\ncargo install struct-cli\n```\n\nView on [crates.io](https://crates.io/crates/struct-cli)\n\n### Option 2: Install from source\n```bash\ngit clone https://github.com/caffienerd/struct-cli.git\ncd struct-cli\nchmod +x install.sh \u0026\u0026 ./install.sh\n```\n\n## Uninstallation\n\n```bash\ngit clone https://github.com/caffienerd/struct-cli.git \u0026\u0026 cd struct-cli\nchmod +x uninstall.sh \u0026\u0026 ./uninstall.sh\n```\n\n---\n\n## Quick Start\n\n```bash\nstruct                          # Full tree (current dir, infinite depth)\nstruct 0                        # Detailed summary of current directory\nstruct 3                        # 3 levels deep\nstruct ~/dir                    # Full tree of a specific directory\nstruct 2 ~/dir                  # Specific directory, 2 levels deep\nstruct ~/dir 2                  # Same — order doesn't matter\nstruct 5 ~/dir -z               # 5 levels with file sizes\n```\n\n---\n\n## Complete Usage Guide\n\n### Syntax\n\n```\nstruct [DEPTH] [PATH] [FLAGS]\nstruct search \"PATTERN\" [PATH] [DEPTH] [FLAGS]\nstruct 0 [PATH]                       → detailed summary view\n```\n\nBoth `DEPTH` and `PATH` are optional positional arguments — no flags needed.\nOrder doesn't matter: `struct 2 ~/dir` and `struct ~/dir 2` both work.\n\n---\n\n### struct 0 — Directory Summary Mode\n\n```bash\nstruct 0\nstruct 0 ~/projects\n```\n\n**Output:**\n```\n/home/user/projects/myproject (main)\n\nsrc/\n  /home/user/projects/myproject/src\n  total:    10 dirs · 45 files · 125.3K\n  visible:  8 dirs · 42 files · 120.1K\n  types:    rs(30) toml(5) md(3) json(2) txt(2)\n  ignored:  target(948 files)\n\nREADME.md\n  12.5K\n\n── ignored (top level) ──\n  .git(60 files), target(948 files) · 1008 files · 45.2M\n```\n\n---\n\n### Git Integration\n\nFilter output by git status. All git flags can be combined with any other flag.\n\nWhen multiple git flags conflict, priority is: `--gc` \u003e `--gs` \u003e `--gu` \u003e `-g` \u003e `--gh`\n\n#### `-g, --git` — tracked files only\n```bash\nstruct -g\nstruct 2 -g ~/git-project\n```\n\n#### `--gu` — untracked files only\n```bash\nstruct --gu\nstruct 2 --gu ~/git-project\n```\n\n#### `--gs` — staged files only\n```bash\nstruct --gs\n```\n\n#### `--gc` — changed/modified files only\n```bash\nstruct --gc\n```\n\n#### `--gh` — last commit per directory\n```bash\nstruct --gh\n```\n\n#### Root variants — start from git root regardless of current directory\n```bash\nstruct --gr        # tracked, from git root\nstruct --gur       # untracked, from git root\nstruct --gsr       # staged, from git root\nstruct --gcr       # changed, from git root\nstruct --ghr       # history, from git root\n```\n\n**Examples:**\n```bash\nstruct 3 -g -z                  # Tracked files with sizes\nstruct --gcr ~/git-project/myapp   # Changed files from repo root\nstruct 2 --gur                  # Untracked files from git root, 2 levels\n```\n\n---\n\n### Flags\n\n#### `-z, --size` — show file sizes\n```bash\nstruct -z\nstruct 3 -z ~/dir\n```\n\n**Output:**\n```\nmain.rs (8.5K)\nvenv/ (156.3M, 2741 files ignored)\n```\n\n#### `-s, --skip-large SIZE` — skip large directories\n```bash\nstruct -s 100                   # Skip dirs \u003e 100MB\nstruct 3 -s 500 ~/dir\n```\n\n#### `-i, --ignore PATTERNS` — inline ignore patterns\nComma-separated, wildcards supported. Merged with config patterns.\n\n```bash\nstruct -i \"*.log\"\nstruct -i \"*.tmp,cache*,build\"\nstruct 3 ~/dir -i \"*.log,screenshots\"\n```\n\n#### `-n, --no-ignore TARGET` — un-ignore\nShow things that are normally hidden. Can be given multiple times.\n\n| Value | Effect |\n|---|---|\n| `all` | Disable ALL ignores |\n| `defaults` | Disable built-in defaults (venv, node_modules, etc.) |\n| `config` | Disable config file patterns only |\n| `PATTERN` | Un-ignore one specific name (e.g. `venv`, `__pycache__`) |\n\n```bash\nstruct -n all                       # Show everything\nstruct -n defaults                  # Show venv, __pycache__, etc.\nstruct -n config                    # Show config-ignored items\nstruct -n venv                      # Peek inside venv only\nstruct -n __pycache__               # Show __pycache__ contents\nstruct -n defaults -n config        # Same as -n all\n```\n\n---\n\n### Config File Management\n\nSave ignore patterns permanently so you don't have to type `-i` every time.\n\n**Location:** `~/.config/struct/ignores.txt`\n\n```bash\nstruct add \"chrome_profile\"     # Add a pattern\nstruct add \"*.log\"\nstruct remove \"*.log\"           # Remove a pattern\nstruct list                     # Show all saved patterns\nstruct clear                    # Delete all saved patterns\n```\n\n**Output of `struct list`:**\n```\ncustom ignore patterns:\n  chrome_profile\n  *.log\n\nconfig file: /home/user/.config/struct/ignores.txt\n```\n\n---\n\n### Search\n\nFind files and directories by pattern. Respects the same ignore rules as the tree view.\n\n```\nstruct search \"PATTERN\" [PATH] [DEPTH] [FLAGS]\n```\n\n**Pattern matching rules:**\n- **Plain text** (no `*` or `?`) → case-insensitive **substring** match\n  - `search \"gui\"` finds `gui.py`, `gui_utils.rs`, `penguin.txt`\n  - `search \"cache\"` finds `__pycache__`, `.cache`, `cache.json`\n- **Glob patterns** (has `*` or `?`) → exact glob match\n  - `search \"*.py\"` finds only files ending in `.py`\n  - `search \"test*\"` finds files starting with `test`\n\n**Basic examples:**\n```bash\nstruct search \"*.py\"                    # All Python files (current dir)\nstruct search \"gui\"                     # Anything containing \"gui\"\nstruct search \"__pycache__\"             # Find all __pycache__ dirs\nstruct search \"*.env\" ~/dir        # .env files in ~/dir\nstruct search \"config*\" ~/dir 2    # Files starting with \"config\", 2 levels deep\n```\n\n**Search flags:**\n\n#### `[DEPTH]` — limit search depth (positional, default: infinite)\n```bash\nstruct search \"*.py\" . 2                # 2 levels deep\nstruct search \"*.toml\" ~/dir 1     # Top level only\n```\n\n#### `-f, --flat` — flat list instead of tree\n```bash\nstruct search \"*.py\" -f\nstruct search \"*.env\" ~/dir -f\n```\n\n**Tree output (default):**\n```\nfound 6 item(s) matching *.py\n\ntimebomb/\n└── Linux/\n    └── python/\n        ├── app_manager.py (11.1K)\n        ├── gui.py (19.4K)\n        └── timer.py (18.5K)\n```\n\n**Flat output (`-f`):**\n```\nfound 6 item(s) matching *.py\n\ntimebomb/Linux/python/app_manager.py (11.1K)\ntimebomb/Linux/python/gui.py (19.4K)\ntimebomb/Linux/python/timer.py (18.5K)\n```\n\n#### `-i, --ignore PATTERNS` — ignore patterns during search\n```bash\nstruct search \"*.wav\" . -i \"windows\"\nstruct search \"*.py\" ~/dir -i \"venv,__pycache__\"\n```\n\n---\n\n## Auto-Ignored Directories\n\nThese are hidden by default (shown with file count instead):\n\n**Python:** `__pycache__`, `.pytest_cache`, `.mypy_cache`, `venv`, `.venv`, `env`, `virtualenv`, `*.egg-info`, `dist`, `build`\n\n**JavaScript:** `node_modules`, `.npm`, `.yarn`\n\n**Version Control:** `.git`, `.svn`, `.hg`\n\n**IDEs:** `.vscode`, `.idea`, `.obsidian`\n\n**Build Artifacts:** `target`, `bin`, `obj`, `.next`, `.nuxt`\n\n**Caches:** `chrome_profile`, `GPUCache`, `ShaderCache`, `Cache`, `blob_storage`\n\n**macOS:** `.DS_Store`\n\nUse `-n all` to show everything, or `-n PATTERN` to peek at one specific folder.\n\n---\n\n## Real-World Examples\n\n```bash\n# Check project structure without clutter\nstruct 3 ~/myproject\n\n# Find all config files in current dir\nstruct search \"*.env\"\nstruct search \"config\" . 2\n\n# See what's actually tracked in git\nstruct 2 -g\n\n# Peek inside an ignored folder\nstruct -n venv\nstruct -n node_modules\n\n# Find large folders\nstruct -z                       # Show all sizes\nstruct -s 100                   # Skip folders \u003e 100MB\n\n# Search with flat output for piping\nstruct search \"*.py\" -f | grep test\n\n# Find __pycache__ dirs across your project\nstruct search \"__pycache__\" ~/dir -f\n\n# Git: see what you're about to commit\nstruct --gsr                    # Staged files from repo root\n```\n\n---\n\n## Features\n\n- **Clean by default**: hides noise (venv, node_modules, .git, caches, build artifacts)\n- **Smart search**: substring match for plain text, glob match for patterns with wildcards\n- **Git integration**: filter to tracked / untracked / staged / changed files\n- **Size awareness**: show sizes with `-z`, skip large dirs with `-s`\n- **Configurable ignores**: save patterns permanently with `struct add`\n- **Flexible output**: tree or flat format for search\n- **Color-coded**: directories in blue, executables in green\n- **Fast**: written in Rust\n\n---\n\n## Why Rust\n\nStarted as a learning project. Turned out to be genuinely useful, so it got polished up. The performance is a nice bonus.\n\n## Contributing\n\nFound a bug? Want a feature? Open an issue. PRs welcome.\n\nDrop a star if you find it useful — it helps!\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaffienerd%2Fstruct-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaffienerd%2Fstruct-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaffienerd%2Fstruct-cli/lists"}