repo2text is a browser-based tool that lets you:
- Select folders and files from your local machine
- Check the exact files or folders you want
- Export the directory structure in a hierarchical format
- Export the contents of selected files in code block format (Markdown style)
- β Lazy folder expansion (only expands when clicked)
- β
Skip hidden folders like
.venv,.git, etc. - β Only export files you explicitly check
- β Prints folder hierarchy even if no files inside are selected
- β All in a single self-contained HTML file β no build step, no backend
- Clone the repo or download
index.html - Run a local server (required due to browser file permissions):
# Python 3+
python -m http.server- Open http://localhost:8000 in your browser
- Click "Choose Files" and select your folder (remember to enable folder selection)
- Expand folders, check what you want, and click "Export Selected"
- View the output in the text box below
# Directory Structure
π folder/
π subfolder/
π file.py
# Files
```folder/subfolder/file.py
<file content here>
---
### πͺ Browser Compatibility
- Chrome / Edge β
- Firefox β (does not support `webkitdirectory`)
- Safari β
---
### π Tech Stack
- HTML + Vanilla JS
- TailwindCSS CDN
---
### π Folder Structure
repo2text/ π index.html π README.md
---
### π License
MIT β use it, fork it, hack it βοΈ
---
### β¨ Future Ideas
- [ ] Download output as `.txt`
- [ ] Filter by file extension
- [ ] βSelect all childrenβ option
- [ ] Keyboard shortcuts (expand/collapse all)