🦆 nestscan — Pretty Directory Trees in One Command
"Because sometimes you just need to see what's actually in a folder without losing your mind."
🚀 Install
pip install nestscan
⚡ Usage
Navigate to any folder and run:
nestscan
It prints a clean, readable tree of your current directory — sorted, structured, color-coded, and easy on the eyes.
You can also point it anywhere:
nestscan /path/to/my/project
🛠 All Options
| Flag | Description |
|---|---|
path |
Target directory to scan (default: current directory) |
-o, --output |
Save the tree to a text file (e.g., -o tree.txt) — ANSI colors are automatically stripped for clean output |
--all |
Include hidden/junk directories like .git, node_modules, venv, etc. |
--stats |
Show file sizes next to every file |
--llm |
Format output for pasting directly into an LLM prompt (wraps in a code block, skips the banner) |
Examples
# Scan the current directory
nestscan
# Scan a specific path
nestscan /home/user/myproject
# Save output to a clean text file
nestscan -o tree.txt
# Show file sizes
nestscan --stats
# Include hidden and junk folders
nestscan --all
# Copy-paste ready output for ChatGPT, Claude, etc.
nestscan --llm
# Combine flags
nestscan /home/user/myproject --stats --all -o full_tree.txt
📋 Example Output
Directory Tree for: /home/user/myproject
==================================================
myproject/
├── src/
│ ├── main.py [ 4.2KB]
│ ├── utils.py [ 1.8KB]
│ └── models/
│ ├── user.py [ 2.1KB]
│ └── post.py [ 1.3KB]
├── tests/
│ ├── test_main.py [ 3.0KB]
│ └── test_utils.py [ 1.1KB]
├── README.md [ 2.4KB]
└── requirements.txt [ 89B]
Clean. Sorted. Directories first. Color-coded by file type.
🎨 Color Coding
| Color | File Types |
|---|---|
| 🟡 Yellow | .py, .pyc, .pyw |
| 🟢 Green | .md, .txt, .csv, .log |
| 🟣 Magenta | .json, .toml, .yaml, .yml, .ini, .cfg |
| 🔴 Red | .sh, .bat, .exe, .dll, .so |
| Bold Cyan | Directories |
✨ What It Does
- 🌲 Recursive tree generation — walks the full directory structure with proper branch characters
- 🎨 Color-coded by file type — instantly see what kind of files you're dealing with
- 📁 Directories first — folders always listed before files at every level
- 🚫 Respects
.gitignore— automatically reads your.gitignoreand skips what it says, plus a built-in fallback list of common junk folders - 📊 Optional file sizes —
--statsshows human-readable sizes (KB,MB, etc.) next to each file - 🤖 LLM mode —
--llmwraps the output in a code block and skips the banner so you can paste your project structure straight into an AI prompt without any cleanup - 💾 Clean file output — when saving with
-o, ANSI color codes are automatically stripped so your text file is actually readable - 🪟 Windows compatible — ANSI colors work there too
🛠 Requirements
- Python 3.6+
- No third-party dependencies — pure stdlib, zero bloat
⚠️ Notes
- Directories you don't have permission to read will show
[Permission Denied]instead of crashing .gitignoreis parsed from the root of the scanned directory — nested.gitignorefiles are not currently supported- Output is sorted alphabetically within each level, with directories always above files
🤝 Contributing
Found a bug? Have a wild idea? PRs welcome.
📜 License
Do whatever you want with it. Just stop doing ls -la and squinting at terminal output like it's 1995.
By turnt ducky 🦆 — also check out reqscan for auto-generating requirements.txt.
Metadata
Release files for nestscan 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nestscan-1.1.0.tar.gz | 5.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nestscan-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.8 kB
Release files / nestscan-1.1.0.tar.gz
| Download URL | nestscan-1.1.0.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
58f9866c67049d726e01caa83d7996793791a08e022bb5481236389e8bb4479a
|
|
BLAKE2b-256 checksum How to use checksums |
d796574bbf5f1b6fea991f3030fab09f69cae4b19c987b78b201774521c94efa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / nestscan-1.1.0-py3-none-any.whl
| Download URL | nestscan-1.1.0-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b741db1f8696af29d3536f16cb9936d47b5ea4c652551276b19ad112728fc19
|
|
BLAKE2b-256 checksum How to use checksums |
697f947c019dcbcb20987bedfc3cc8a9155a526b15fec0bf5fb3585246df64f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|