aider
aider copied to clipboard
Add the ability to add images that are not part of the git repo
Aider v0.27.0
Model: gpt-4-1106-preview using udiff edit format
Git repo: .git with 20 files
Repo-map: using 1024 tokens
I'd like to show the model screenshots of the app that the model is working on. As far as I can tell, the only way to do this (without disabling the git integration) is this:
- take the screenshot
- move the screenshot file into the git repo
- git add the image
- commit
- use /add in aider
I'd like the ability to add images from any place in the file system. It might be better to create a new command for this (like /image) as to not change the behaviour of /add.
Thanks for trying aider and filing this issue.
You don't need to add/commit the image to repo, although it does need to be located someplace in the repo's directory tree.
I've made a change so that image files can be anywhere in the filesystem. I'll merge it to main soon.
The change is available in the main branch. You can get it by installing the latest version from github:
python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git
If you have a chance to try it, let me know if it works better for you.
Thanks for the quick response. I tried and it worked, but I ran into some issues:
- I don't know how to make it work if the path contains spaces. I tried to surround the path with single quotes and tried to escape the spaces, but it didn't work.
- The reason I first thought adding files not committed to git is not supported, is because of the lack of auto completion. Would it be possible to add that? Especially if it were able to resolve ~ to $HOME. Currently I have to manually build the path and copy and past it into aider, which is rather cumbersome.
You should be able to do /add "file name with spaces.jpg" to add file names with spaces. Or you can add such files from the command line when you launch aider aider "file name with spaces.txt".
For auto-completing files that aren't part of the git repo, best thing for now might be to add them when you launch aider and rely on your shell's autocomplete.
I'm going to close this issue for now, but feel free to add a comment here and I will re-open or file a new issue any time.