Skip to content

Instantly share code, notes, and snippets.

@cpietsch
Created September 29, 2024 10:01
Show Gist options
  • Save cpietsch/4ea82867236d1a1cc4a6e42bd1801b43 to your computer and use it in GitHub Desktop.
Save cpietsch/4ea82867236d1a1cc4a6e42bd1801b43 to your computer and use it in GitHub Desktop.
bash command to recursive combine js/ts files into one file to use as context for LLMS like GPT
find path/to/folder -type f \( -name "*.(js|ts)" -o -name "*.ts" \) -print0 |
while IFS= read -r -d '' file; do
echo "## $(basename "$file")"
cat "$file"
done
} > codebase.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment