It’s awesome that custom prompts now can contain any @ syntax, but it’s quite cumbersome to create an maintain such prompts by hand. Is there any way to do it programmatically?
I have medium-ish set of files I want to include in the prompt and which these files are can change sometimes. Just doing the initial selection is quite annoying.
Ideally I would want to be able to generate the prompts as xml/json/whatever
But you can try to copy existing prompt with file links and then inspect the clipboard contents (using tools like Clipboard Inspector or locally), for example, for me it outputs:
so I believe that it’s possible to programmatically generate and fill clipboard with your defined file prompt and then you could paste that in Cody’s chat window and Cody should identify the files mentioned correctly.
UPDATE: seems like they might be in the process of switching from Lexical to a ProseMirror based editor - which likely would change the clip-board format.
UPDATE: Using the “Copy” button in the web prompt manager give yet another format. A plain text format where @references are encoded as cody://serialized.v1?data=$BASE64DATA_ Where $BASE64DATA is a url encoded json structure. (this format does not handle escaping, so it’s not possible to save a prompt mentioning a such a string without having cody interpret it as a reference. Ie. if you write in such a text string manually and save, cody will still interpret it as a reference.
UPDATE: vscode does not understand the cody://serialized.v1? format (which is not really a problem)