-
Hey, I wonder if it is possible to run same prompt on different files without approval (e.g. I want to instruct AI to remove specific code). I found how to disable approval, there are events I can react to. So it seems it is doable. Before investing any time to that I wonder if someone already has done something like that? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I don't understand what you're asking for. Can you explain in terms of a real use case? |
Beta Was this translation helpful? Give feedback.
-
OK. Let's say I have following jsx file: import React from 'react';
function HelloWorld() {
return (
<div>
<h1>Hello, World!</h1>
<p>This is paragraph</p>
</div>
);
}
export default HelloWorld; I have following prompt: #buffer
@editor
Wrap all strings with `t` function from react-i18next. Assume react-i18next is installed. Result is following: import React from 'react';
import { useTranslation } from 'react-i18next';
function HelloWorld() {
const { t } = useTranslation();
return (
<div>
<h1>{t("Hello, World!")}</h1>
<p>{t("This is paragraph")}</p>
</div>
);
}
export default HelloWorld; Let's assume result is good for me and I want now to do the same in remaining 200 jsx files in the project. I don't care if that will be done 100% correct - I will review diffs later. Can this be done using codecompanion? |
Beta Was this translation helpful? Give feedback.
-
In the end codecompanion.nvim is not necessary right tool for all the tasks. I will investigate further idea updating multiple files via LLM from CLI which seems to be more viable option. There are some CLI apps to talk with different models, e.g. I found these two useful: https://ollama.com/ might be used as well BTW if running LLM locally is an option. Now since I am forced to use GitHub Copilot in some situations I have created https://github.com/daliusd/copilot-cli where I will experiment further. |
Beta Was this translation helpful? Give feedback.
In the end codecompanion.nvim is not necessary right tool for all the tasks. I will investigate further idea updating multiple files via LLM from CLI which seems to be more viable option. There are some CLI apps to talk with different models, e.g. I found these two useful:
https://ollama.com/ might be used as well BTW if running LLM locally is an option.
Now since I am forced to use GitHub Copilot in some situations I have created https://github.com/daliusd/copilot-cli where I will experiment further.