Aider-AI / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
21.33k stars 1.99k forks source link

REQ: Ability to toggle --verbose function on and off from within aider, perhaps /verbose-debug ? #1870

Open 5ocworkshop opened 1 month ago

5ocworkshop commented 1 month ago

Issue

It would be really useful, to aid in debugging issues and understanding the "behind the curtain" work aider is doing, to be able to toggle the verbose output seen with --verbose, on and off, from within aider using something like /verbose-debug on|off

This would make it possible to more quickly provide detailed debug information when an issue is encountered.

Version and model info

No response

5ocworkshop commented 3 days ago

I apologize, I'm not up to speed on managing git and submitting PRs yet but I resolved this one myself today and it's a really easy fix so I wanted to share it here in case anyone else wants to add it or Paul or someone can merge it in.

In the aider/commands.py file under cmd_report at the bottom, add:

def cmd_verbose(self, args):                                                                                                                                                                                                                  
     "Toggle verbose mode on/off"                                                                                                                                                                                                              
     self.args.verbose = not self.args.verbose  # Toggle the args setting                                                                                                                                                                      
     self.verbose = self.args.verbose  # Update Commands instance                                                                                                                                                                              
     self.io.verbose = self.args.verbose  # Update InputOutput instance                                                                                                                                                                        
     self.coder.verbose = self.args.verbose  # Update Coder instance                                                                                                                                                                           
     state = "on" if self.args.verbose else "off"                                                                                                                                                                                              
     self.io.tool_output(f"Verbose mode is now {state}")  

Now when you need the verbose output, you can just use "/verbose" to toggle it on or off. Very handy for debugging.