{"by":"mpoon","descendants":149,"id":35191303,"kids":[35191663,35191830,35192603,35191526,35193687,35191470,35192011,35193131,35193373,35191468,35209882,35193965,35199419,35229720,35265386,35192329,35191544,35229823,35194717,35191700,35194703,35192112,35212889,35192222,35197931,35192194,35192391,35192048,35207312,35194646,35192583,35192967,35200280,35198006],"score":373,"text":"I was getting tired of copy&#x2F;pasting reams of code into GPT-4 to give it context before I asked it to help me, so I started this small tool. In a nutshell, gpt-repository-loader will spit out file paths and file contents in a prompt-friendly format. You can also use .gptignore to ignore files&#x2F;folders that are irrelevant to your prompt.<p>gpt-repository-loader as-is works pretty well in helping me achieve better responses. Eventually, I thought it would be cute to load itself into GPT-4 and have GPT-4 improve it. I was honestly surprised by PR#17. GPT-4 was able to write a valid an example repo and an expected output and throw in a small curveball by adjusting .gptignore. I did tell GPT the output file format in two places: 1.) in the preamble when I prompted it to make a PR for issue #16 and 2.) as a string in gpt_repository_loader.py, both of which are indirect ways to infer how to build a functional test. However, I don&#x27;t think I explained to GPT in English anywhere on how .gptignore works at all!<p>I wonder how far GPT-4 can take this repo. Here is the process I&#x27;m following for developing:<p>- Open an issue describing the improvement to make<p>- Construct a prompt - start with using gpt_repository_loader.py on this repo to generate the repository context, then append the text of the opened issue after the --END-- line.<p>- Try not to edit any code GPT-4 generates. If there is something wrong, continue to prompt GPT to fix whatever it is.<p>- Create a feature branch on the issue and create a pull request based on GPT&#x27;s response.<p>- Have a maintainer review, approve, and merge.<p>I am going to try to automate the steps above as much as possible. Really curious how tight the feedback loop will eventually get before something breaks!","time":1679014794,"title":"Show HN: GPT Repo Loader – load entire code repos into GPT prompts","type":"story","url":"https://github.com/mpoon/gpt-repository-loader"}