Skip to content
Farham Kh edited this page Aug 18, 2025 · 1 revision

Folder Code Scraper

A lightweight Python tool to extract all source code from a project folder into a single Markdown or text file. Perfect for sharing entire projects with AI models, collaborators, or for documentation.


CodeScraperImage

Features

  • Recursively scans all files in a chosen directory
  • Collects source code and organizes it by file
  • Option to include relative file paths (safe for sharing)
  • Outputs clean .txt or .md file ready for AI prompts

Installation

Make sure you have Python 3.8+ installed. Clone the repo:

git clone https://github.com/Farhamkh/folder-code-scraper.git
cd folder-code-scraper

Usage

Run the scraper:

python scraper.py

You’ll be asked:

Which folder to scrape

Where to save the output file

Whether to include file paths (yes/no flag)

Example Output

--- File: src/app/page.tsx ---

--- File: src/utils/helpers.js ---

Privacy Notes

The script does not expose your absolute system paths (unless you choose to include them).

.env, node_modules, and build files should already be ignored via .gitignore.

Safe for uploading results to GitHub or AI prompts.

Use Cases

Feed an AI assistant the entire context of your project

Create a snapshot of project structure for documentation

Easy code sharing without zipping the repo

License

This project is licensed under the MIT License.

Clone this wiki locally