aider icon indicating copy to clipboard operation
aider copied to clipboard

Feature; Option to remember the last /add files

Open Nucs opened this issue 1 year ago • 3 comments

Issue

It could be very helpful to have an option to automatically restore files from last chat to current chat. /drop * solves incase you want to start from scratch. loading the files manually again is much more painful.

Version and model info

No response

Nucs avatar Jun 14 '24 19:06 Nucs

Thanks for trying aider and filing this issue.

You can use up-arrow to go back through your prior chat inputs. Or CONTROL-R to search them. So searching for /add would let you re-use the previous add command.

Or you can specify the filenames on the command line aider file1 file2 ... and use you shell history to launch aider with the same set of files again.

paul-gauthier avatar Jun 14 '24 22:06 paul-gauthier

For the most part, it works great but no wildcard support. e.g. aider *context*.ps1 *_test.ps1 This in my perspective can be a good addition. With that said, /add and /drop support wildcards perfectly fine.

(aider) C:\Users\ELI\workdir>aider *context*.ps1 *_test.ps1
Traceback (most recent call last):
  File "C:\Users\ELI\anaconda3\envs\aider\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\ELI\anaconda3\envs\aider\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\ELI\anaconda3\envs\aider\Scripts\aider.exe\__main__.py", line 7, in <module>
    sys.exit(main())
  File "C:\Users\ELI\anaconda3\envs\aider\lib\site-packages\aider\main.py", line 263, in main
    fnames = [str(Path(fn).resolve()) for fn in args.files]
  File "C:\Users\ELI\anaconda3\envs\aider\lib\site-packages\aider\main.py", line 263, in <listcomp>
    fnames = [str(Path(fn).resolve()) for fn in args.files]
  File "C:\Users\ELI\anaconda3\envs\aider\lib\pathlib.py", line 1215, in resolve
    s = self._flavour.resolve(self, strict=strict)
  File "C:\Users\ELI\anaconda3\envs\aider\lib\pathlib.py", line 215, in resolve
    s = self._ext_to_normal(_getfinalpathname(s))
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '*context*.ps1'

Nucs avatar Jun 15 '24 01:06 Nucs

Are you sure you are using your shell's wildcard syntax correctly?

paul-gauthier avatar Jun 20 '24 14:06 paul-gauthier

+1 for adding a way to automatically restore the user files from the end of the previous session. In my experience, most of the files that are /add-ed are added by the llm, not by me, so searching through my input history wouldn't find them anyway.

This would be analogous to --restore-chat-history, which I find extremely useful for not being anxious about exiting and restarting aider, e.g. when vscode or my OS is pestering me to allow an update. So I think adding a new option like --restore-user-files that users could combine with --restore-chat-history would be a great improvement for usability.

jdanbrown avatar May 01 '25 18:05 jdanbrown

This would be really useful. Going back in history and finding the /add messages does not cut it. Often you add the files through many /add commands and it's painful to find all of them.

raine avatar May 18 '25 10:05 raine

This would be great. Searching for /add messages, even using Ctrl+R, is painful. I also tried using AIDER_FILE=* to try to add all previously added files (as implied by /help: https://github.com/Aider-AI/aider/issues/166#issuecomment-2356401326), but it just created a file called * and added it.

denyeo avatar Aug 03 '25 19:08 denyeo