Aider-AI / aider

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

REQ: /macroX command to recall text strings like frequently used prompts #1704

Open 5ocworkshop opened 2 weeks ago

5ocworkshop commented 2 weeks ago

Issue

It would be nice to be able to store numeric macros like /macro[0-9] for example to summon frequently used prompts.

Version and model info

Aider v0.57.1 Main model: claude-3-5-sonnet-20240620 with diff edit format, prompt cache, infinite output Weak model: claude-3-haiku-20240307

5ocworkshop commented 1 week ago

Thinking about this further, it might be nice if a macro could also be a series of commands. For example, a macro that takes the prompt string, switches models to a specific model (like o1 to Sonnet) and runs the command, returns the response, and switches back to the previous context (o1).

UPDATE: It might also be nice to short-hand them to /m[0-9] to make it even faster to activate the macro

5ocworkshop commented 5 days ago

I wanted to add a user case to demonstrate how this might be used beyond just a prompt macro.

I have a debug.md file that contains various debug phrases, some of which are combined by referring to various XML tages. So for example if I say "Use conventions/debug.md and RootDebug" it will use a combination of prompts from my debug.md file.

However, I don't want the debug file loaded all the time but I would like to have a macro that would load the file and issue the command for example:

/m1 [load macro 1] does

/read conventions/debug.md
Use conventions/debug.md and RootDebug [and leaves the cursor here so I can paste in logs or tracebacks or add further comment]

/m2 might do

/clear
/read conventions/debug.md
Use conventions/debug.md and RootDebug [and leaves the cursor here so I can paste in logs or tracebacks or add further comment]

And finally /m3 might unload the debug file to save tokens /drop conventions/debug.md