Skip to content

Instantly share code, notes, and snippets.

View Xopoko's full-sized avatar

Maksim Kudriavtsev Xopoko

View GitHub Profile
@Xopoko
Xopoko / collect_files.py
Last active January 19, 2025 01:20
This script collects source files from a specified directory (recursively), excludes certain folders, and combines their content into a single output file. It's designed for sharing project code with LLMs efficiently by copying the output to the clipboard.
#!/usr/bin/env python3
import os
import sys
import fnmatch
import argparse
import pyperclip
import re
# Make sure you have tiktoken installed if you intend to use --calculate-tokens
try: