Skip to content

Instantly share code, notes, and snippets.

View shawn-albert's full-sized avatar

Shawn Albert shawn-albert

View GitHub Profile
@shawn-albert
shawn-albert / code_context_consolidator.py
Created November 18, 2024 14:59
Consolidate code files from a specified directory into a single text file for LLM context. This script traverses a given directory, collects code files, and compiles them into a single text file with appropriate code blocks and directory structure. It supports inclusion and exclusion of specific file types, files, and folders.
#!/usr/bin/env python3
"""
Code Context Consolidator
Consolidate code files from a specified directory into a single text file for LLM context.
This script traverses a given directory, collects code files, and compiles them into a single
text file with appropriate code blocks and directory structure for providing context to an LLM.
It supports inclusion and exclusion of specific file types, files, and folders.