A simple Python script that generates a Markdown overview of your projectβs folder structureβcomplete with depth control and inline includes of your README.md, package.json, and composer.json. Outputs to filetree.md, with an optional --clip flag to copy the result to your clipboard.
-
Directory tree Recursively list files and folders in Markdown format.
-
Depth control Limit recursion depth with
--depth(or-d). -
Inline includes Automatically pull in:
README.mdpackage.jsoncomposer.json
-
Clipboard copy Off by default; enable with
--clip.
-
Python 3.6+
-
pip install pyperclip
-
Clone or download this repo.
-
Ensure
filetree.pyis executable (or run viapython). -
Install dependencies:
pip install pyperclip
Run from your projectβs root folder:
# Generate full tree β filetree.md (no clipboard)
python3 filetree.py
# Limit to 2 levels deep
python3 filetree.py --depth 2
# Include clipboard copy
python3 filetree.py --clip
# Both depth and clipboard
python3 filetree.py --depth 3 --clip-
--depth, -d <int>Maximum folder depth (default: unlimited). -
--clipCopy the final Markdown to your clipboard.
-
filetree.md
- Starts with a βπ Project File Treeβ heading
- Bullet-list directory structure
- Sections for
README.md,package.json, andcomposer.json(if present)
-
Clipboard (if
--clip): the same content is copied and ready to paste
# π Project File Tree
- filetree.py
- src
- main.py
- utils.py
- tests
- test_main.py
---
## π README.md
β¦(your README content)β¦
---
## π¦ package.json
β¦(your package.json content)β¦
---
## π§ composer.json
β¦(your composer.json content)β¦