Package: agentgrunt
🕵🧰 AgentGrunt ️Use OpenAI'sCode Interpreterto edit and commit code across your entire git repo (even non-python repos)!OverviewAgentGrunt packs up the following: a codebase you specify, a specially preparedgitbinary that runs well in Code Interpreter's environment, and some prompts and code exploration tools into a single file that you can load into Code Interpreter.Upload the archive, paste in a two sentence prompt, wait a bit, and then sit back and relax while GPT4.5*writes, edit, and commits your code for you. Once GPT has finished making your changes, pressdfrom the hotkey menu and ChatGPT will send you a file you can use to apply the commits GPT made (with all their metadata!) directly into your copy of the repo.Features:automatically installsgitinto Code Interpreter and configures it for code explorationbuilt in hotkey menu for easy usagesimple, small, and easy to customize.InstallationPrereqs:a valid ChatGPT Plus subscription and Code Interpreter enabled in ChatGPT's settingsa working installation of python 3.9 (or newer)a git repository that you'd like Code Interpreter to work on with youOnce you have those in place, run:pipinstallagentgruntIf all goes well runningagentgrunt --helpwill output something like this:Usage: agentgrunt [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  bundle               Bundle up a local or remote git repo
  custom-instructions  Copy ChatGPT custom instructions to the clipboardUsageTo start editing a repo withagentgruntuseagentgrunt'sbundlecommand:agentgruntbundle<path-to-your-repo>It will do some work and then print out some instructions. When the process has completed you'll have a new file called<your-repo-name>.tar.gzin your current folder.Now do the following:Copy the short promptagentgruntprints out to the clipboard (or just sayywhen prompted if on macOS)Open up ChatGPT and start a new chat in Code Interpreter modeUse the + button to upload the<your-repo-name>.tar.gzfile AgentGrunt generatedPaste the prompt you copied a second ago into the chatbox and press sendYou'll see ChatGPT start to do some work, and after a few moments you'll be greeted with a message saying "Code Interpreter is now running AgentGrunt!" followed by a hotkey menu similar to the below:c ) continue 
d ) download changes as patch
dr) download entire repo
m ) show diff of last change
r ) refresh/reload agentgrunt
w ) work autonomously until complete
? ) show this hotkey listNow just ask Code Interpreter to make some changes to your repo, and hitdwhen you're finished to download the changes it made to your local copy of the repo!When you want to download the changes you've made to your local copy of the repo, hitdand Code Interpreter will send you a.patchfile that you can apply to your copy of the git repo using the (somewhat esoteric)git amcommand:gitam<path-to-patch-file>How it worksWhen you ask AgentGrunt to generate a bundle it first downloads a single-file version of thegitbinary from 1bin.org (an older project of mine to make easy to deploy single file binaries of common utilities). Then it clones the repo you point it at into a temporary location location (to avoid bundling up any files that aren't part of the repo, egnode_modulesfolders), copies thegitbinary and some prompts teaching Code Interpreter how to use AgentGrunt's tools into a temp folder and then builds a tarball out of the whole collection.The python package contains agpt_toolsfolder that gets copied into each bundle AgentGrunt generates.gpt_toolsincludes a prompt for Code Interpreter in theREADME_ai.mdfile, as well as some python functions that are useful for code exploration that Code Interpreter can load and call directly (seecode_exploration.py).This arrangement allows the prompt the user has to paste into ChatGPT to be short and simple. Code Interpreter itself can then extract the longer prompt from README_ai and bootstrap itself from there.Caveats and gotchasGPT4 makes a lot of mistakes and is easily confused! While AgentGrunt can be genuinely useful, it's not going to be replacing a human dev any time soon. Expect it to require a fair bit of babysitting and handholding to be able to accomplish meaningful tasks.During longer conversations GPT4 tends to forget what it's doing and sometimes stops showing the hotkey menu or thatgitand the tools fromcode_exploration.pyfunctions are available. If this happens, hitror ask it to re-read "it's" readme file to refresh its memory.Code Interpreter is subject to a ~2 minute timeout while working autonomously, so for longer running operations you may need to tell itc(continue) to have it finish what it was doingSometimes Code Interpreter sends diff output instead of properly formatting a commit patch, especially if the changes it's made haven't been committed yet. If this happens, userto refresh the prompt, or explicitly direct it to make a commit and then send a patch.Code Interpreter deletes it's workspace files if it's been left idle for too long (seems to be in the ~10-15m range), and when this happens any links to files it may have sent you will stop working.Make sure to download any patch files it sends you immediately to avoid losing your work!Final thoughtsThis is still early and more of a proof of concept than anything else. That said, even in it's current form it's often genuinely useful! Allowing Code Interpreter to read files and archives in this way also opens the door for lots of interesting applications. AgentGrunt only uses one prompt, but it's easy to imagine more complex tools like this that include a catalogue of prompts that "daisy-chain" from each other, am very curious to see what other things people build in this vein!Hattip to@NickADobos' and his "AI zip bomb" thread for the inspiration!