🤖 AI Summary
A simple Bash one-liner was shared for quickly concatenating every file in a directory tree into a single text blob suitable for pasting into an LLM:
find . -type f ! -name 'combined_output.txt' ! -name '.png' ! -name '.css' -print0 | xargs -0 -I {} sh -c 'echo "Full path: {}"; echo "-------------------"; cat "{}"; printf "\n-------------------\n"' > combined_output.txt. It walks the current directory, prints a file header for each file, cat’s its contents, and writes everything to combined_output.txt; the example shows it picking up files in subdirectories. The exclusion patterns (.png, .css and the output file itself) are easily adjusted to include or ignore other extensions.
For AI/ML practitioners this is a fast way to assemble a codebase or dependency snapshot into a single context for model-assisted code review, debugging, or documentation generation. Important caveats: large or binary files and sensitive secrets can blow past LLM token limits or leak data, so filter by extension, use git ls-files to limit to tracked sources, or pipe through line/byte limits and chunking strategies. You can also augment the pipeline with grep/sed/ripgrep for selective inclusion, or split the combined output into chunks to fit model context windows.
Loading comments...
login to comment
loading comments...
no comments yet