Skip to content

A Python CLI tool that recursively combines project source files into a single, structured text file — perfect for sharing full project context with AI assistants or collaborators. Automatically filters out large files, media, and irrelevant folders, while preserving file paths for easy navigation.

Notifications You must be signed in to change notification settings

v01gh7/Project-Context-Combiner-Python-CLI-Tool-for-AI-And-Code-Review

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

📦 Project Context Combiner — Python CLI Tool for AI & Code Review


📌 Description

Project Context Combiner is a lightweight Python utility that recursively scans your project folder and merges all relevant source files into a single structured text file, ready to paste into an AI chat or share with a collaborator.

It automatically:

  • Skips media files (images, audio, video)
  • Skips large files (> 1 MB) and large folders (> 3 MB)
  • Preserves file paths above each code block for context
  • Copies the entire combined content to your clipboard
  • Deletes the temporary output file automatically

Perfect for AI code assistance — provides full project context in one paste
Clean & lightweight — no heavy dependencies (only pyperclip)
Structure-preserving — easy for AI or humans to understand code location
No manual zipping — one command and you're done


🚨 The Problem

❌ Without this 💥 Issue
Sending single files to AI Loses project-wide context
Manual zipping & explaining structure Time-consuming
Including large/binary files Bloats the output & wastes tokens
No clipboard integration Requires manual copy-paste

🛠 How This Works

✅ Feature 🚀 Benefit
Recursively scans the project folder Captures all relevant code
Skips media, config, lock files Keeps output clean
File path comments above each block Maintains structure
Size filters for files & folders Avoids bloat
Auto-copy to clipboard Ready for AI chat instantly
Auto-delete temporary file No leftover junk

⚙️ Installation & Usage

Install dependencies

pip install pyperclip

Run the script

python combine_files.py <directory_path> <output_filename>

Example:

python combine_files.py ./myproject combined_code

After running:

  • The combined code will be copied to your clipboard
  • The temporary .txt file will be deleted automatically

📂 Example Output

# /path/to/project/app/main.py
print("Hello world")

# /path/to/project/utils/helpers.py
def add(a, b):
    return a + b

This structure helps AI or reviewers instantly know where each piece of code lives.


📌 Tech Overview

Component Details
Language Python 3+
Dependencies pyperclip
Usage Scope Any text/code-based project
Output Format Single .txt (clipboard + temp file)

💻 Tech Stack

Python Automation No Dependencies CLI Tool Cross-platform Clipboard Integration Open Source


📦 License

MIT — free to use, modify, and integrate.


⭐ If this tool saved you time — star it on GitHub and share it with fellow developers!

About

A Python CLI tool that recursively combines project source files into a single, structured text file — perfect for sharing full project context with AI assistants or collaborators. Automatically filters out large files, media, and irrelevant folders, while preserving file paths for easy navigation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages