diff --git a/aider/commands.py b/aider/commands.py index 3881403c5c1..6c15c3558df 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -799,7 +799,10 @@ def glob_filtered_to_repo(self, pattern): def cmd_add(self, args): "Add files to the chat so aider can edit them or review them in detail" + from aider import prompts + all_matched_files = set() + added_fnames = [] filenames = parse_quoted_filenames(args) for word in filenames: @@ -880,6 +883,7 @@ def cmd_add(self, args): self.io.tool_output( f"Moved {matched_file} from read-only to editable files in the chat" ) + added_fnames.append(matched_file) else: self.io.tool_error( f"Cannot add {matched_file} as it's not part of the repository" @@ -901,6 +905,10 @@ def cmd_add(self, args): fname = self.coder.get_rel_fname(abs_file_path) self.io.tool_output(f"Added {fname} to the chat") self.coder.check_added_files() + added_fnames.append(fname) + + if added_fnames: + return prompts.added_files.format(fnames=", ".join(added_fnames)) def completions_drop(self): files = self.coder.get_inchat_relative_files()