Skip to content

Instantly share code, notes, and snippets.

@lalilaloe
Last active May 25, 2024 20:41
Show Gist options
  • Save lalilaloe/73a71a1ed0180f789cdba9492d88572c to your computer and use it in GitHub Desktop.
Save lalilaloe/73a71a1ed0180f789cdba9492d88572c to your computer and use it in GitHub Desktop.
Git repo in single .txt. For use in context for LLM (ex. Google Gemini) / Combine certain files in folder into one text file (recursive)

Create a file that contains all required files for understanding a repository fully. Might need to add docs or .ts.d files for some node_modules

// Typescript and json files

find ./ -type f \( -name \*.json -o -name \*.ts) -not -path "./node_modules/*" -print0 | xargs -0 -I file tail -n +1 file -v >merged_file.txt

// Example for a .svelte application

find ./ -type f \( -name \*.svelte -o -name \*.ts -o -name \*.json -o -name \*.cjs -o -name \*.html \) -not -path "./node_modules/*" -print0 | xargs -0 -I file tail -n +1 file -v >merged_file.txt

Ask the llm if more context is needed, include those files. For example in the svelte application include the svelte, vite and tailwind config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment