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.md
package.json
composer.json
-
Clipboard copy Off by default; enable with
--clip
.
-
Python 3.6+
-
pip install pyperclip
-
Clone or download this repo.
-
Ensure
filetree.py
is 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). -
--clip
Copy 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)…