Skip to main content

A dynamic directory tree generator that skips the junk by default.

Project description

๐Ÿฆ† 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 .gitignore and skips what it says, plus a built-in fallback list of common junk folders
  • ๐Ÿ“Š Optional file sizes โ€” --stats shows human-readable sizes (KB, MB, etc.) next to each file
  • ๐Ÿค– LLM mode โ€” --llm wraps 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
  • .gitignore is parsed from the root of the scanned directory โ€” nested .gitignore files 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nestscan-1.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nestscan-1.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file nestscan-1.1.0.tar.gz.

File metadata

  • Download URL: nestscan-1.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for nestscan-1.1.0.tar.gz
Algorithm Hash digest
SHA256 58f9866c67049d726e01caa83d7996793791a08e022bb5481236389e8bb4479a
MD5 0ddb47a28eb78ade7898bf25d2cf3f43
BLAKE2b-256 d796574bbf5f1b6fea991f3030fab09f69cae4b19c987b78b201774521c94efa

See more details on using hashes here.

File details

Details for the file nestscan-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: nestscan-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for nestscan-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b741db1f8696af29d3536f16cb9936d47b5ea4c652551276b19ad112728fc19
MD5 4c7ae9fb55f924cf3ea49c94bbbe9b22
BLAKE2b-256 697f947c019dcbcb20987bedfc3cc8a9155a526b15fec0bf5fb3585246df64f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page