JeremiahPetersen / RepoToText

Turn an entire GitHub Repo into a single organized .txt file to use with LLM's (GPT-4, Claude Opus, Gemini, etc)
MIT License
451 stars 57 forks source link

Helpful quick terminal alternative #9

Open pauljones0 opened 3 months ago

pauljones0 commented 3 months ago

Hi guys, if you want to get the same result, without starting a docker container, and running all the code, you can git clone the repo, then run the following:

find ./FOLDERTOCLONEHERE -type f -print | sort | xargs awk 'BEGINFILE {printf "\n\\\047\\\047\\\047---"; print FILENAME; printf "---\\\047\\\047\\\047\n"} {print} ENDFILE {printf "\n\\\047\\\047\\\047---\n"}' > NAMEOFOUTPUTFILEHERE.txt

If this code is wrong, please comment below as such.

Figured I should post this here, as it's saved me time, hopefuly others find it the same way. Maybe this should be added to the README? If not, may the adventurous find their answers here.

JeremiahPetersen commented 3 months ago

Hi Paul, ty for sharing this! I will test it out later and if it all works, I'll definitely add it to the readme :)