Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support for IDE Companion #2066

Open
wladimiiir opened this issue Oct 16, 2024 · 6 comments · May be fixed by #2067
Open

Feature Request: Support for IDE Companion #2066

wladimiiir opened this issue Oct 16, 2024 · 6 comments · May be fixed by #2067
Labels
enhancement New feature or request

Comments

@wladimiiir
Copy link

wladimiiir commented Oct 16, 2024

Motivation

When working with aider, users usually have IDE opened with the project code to see the changes and modify code parts manually. It would be very usefull to be able to automatically add files opened in IDE to aider context, so users do not have to worry about managing them via /add//drop commands.

Solution

Aider would fetch open files from IDE via Rest API provided by IDE's plugin or extension.

IntellijIDEA

I have created simple plugin that spins up Rest API server on localhost:24337 (port choosen as alphanumeric value of 'aider'). The API provides the following endpoint:
POST /open-files

{
   "projectBase": "/home/wladimiiir/Projects/my-project"
}

Version and model info

No response

@wladimiiir wladimiiir linked a pull request Oct 16, 2024 that will close this issue
@wladimiiir
Copy link
Author

I have prepared PR for the changes required on the aider side. Happy to start the discussion about the possible improvements.

Companion should introduce communication between aider and IDE, so there are additional open feature possibilities of using it in the future (e.g. adding a selected code to the aiders chat, invoking Refactor command on selected code...)

@5ocworkshop
Copy link

This is an interesting and cool idea. I like it. It's a different spin on something I also just suggested to improve the workflow and adding files to the chat: #2068

@sengokudaikon
Copy link

There is a VSCode extension that already does this without a rest API. This could be a good way for Jetbrains IDEs and others, but it's generally not the best case solution

@wladimiiir
Copy link
Author

@sengokudaikon
Thanks, I checked the extension. It is running aider inside the IDE, which makes it possible to manage /add, /drop automatically. For Idea there also is a similar plugin that integrates aider directly into the IDE. I actually find it better to have it separated from IDE, so that's why I have chosen this approach. Currently IDE extension provides Rest API which aider should be able to use, but I am starting to lean towards the idea of having aider have it's own Rest API for the commands it provides and the external application integrating with aider would be able to use that. The only problem I can I usually have multiple instances of aider running for different projects at once and that would make it harder to manage connections as you would need multiple ports (or having API server running on top of aider instances).

I am interested in Paul's take on this and see what he thinks would be the best approach given his general overview and idea of aider's capabilities.

@p-wegner
Copy link

I would also very much prefer to have aider provide REST endpoints for its commands. This would open up a few use cases and ideally extend its scriptability without the need to fork it or run it from python.

@paul-gauthier paul-gauthier added the enhancement New feature or request label Oct 23, 2024
@kinchahoy
Copy link

I would also very much prefer to have aider provide REST endpoints for its commands. This would open up a few use cases and ideally extend its scriptability without the need to fork it or run it from python.

+1 to this. The biggest issue using Aider vs. an in IDE solution like Cursor is the inability to "apply" individual proposed edits while looking at the file itself. Sometimes models end up rewriting too much of a file, or tweaking them unncessarily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants