Aider's website describes the tool best:
Aider is a command line tool that allows you to pair program with GPT-3.5/GPT 4.0. You can start a new project or work with an existing repo. Aider makes sure edits from GPT are committed to git with sensible commit messages. Aider is unique in that it lets you ask for changes to pre-existing, larger codebases.
As a frequent user of Aider, I was looking for a way to accomplish three goals:
/add filename
and /drop filename
and thought maybe I could make an extension that automates away those chores.I'm really new at writing VSCode plugins. Given that I like Aider, it might not surprise you that I ran:
Write a VSCode extension for running aider. The extension should keep track of open files, it should run \add and \drop to keep the commands inside of the tool synchronized with the open file list inside of VSCode.
This command created about 70% of version 0.0.1 of this plugin. Alas, there are some things are not quite right yet.
vscode.workspace.textDocuments
doesn't seem to return all the tabs I have open all of the time. I've also tried vscode.window.visibleTextEditors
, it also refused to return all the open tabs all of the time. This mostly seems to happen when I've first starting up VSCode and it's using previously saved tabs. First and foremost, you need to have aider installed. If you don't have this done already, head over to the Aider website to get it installed.
After that's done, I would suggest doing three things:
/opt/homebrew/bin/aider
.aider --model gpt-4-1106-preview
If you have any trouble whatsoever with setting the working directory for aider, I encourage you to set the "working directory" setting. This will prevent the plugin from trying to figure out the working directory by itself.
Run the "Aider Open" command from your Command Palette to start the plugin. This should always be the first step, as no other commands will work until it's open.
Aider relies on the user to specify the files that will need to change in order to accomplish the commands you give it. If you've used aider before, you'll be familiar with running /add filename
and /drop filename
to accomplish this. When using this plugin, whatever files you have open in your editor will automatically be in the aider chat.
If you're ready to have Aider make some changes to your site, go to Aider terminal window and do some pair programming with Aider. If you are new to Aider, I recommend checking out the Aider web site's examples page.
The aider tool was written by Paul Gauthier. I am not a contributor on that project, but after using it extensively, I (Matt Flower) decided to write the Aider plugin for VSCode.
Please report any bugs to the issues page on the GitHub site for this extension.
I'm enjoying writing this plugin, and I'm enjoying using it. If you think you know the answer to any of the problems listed above (or other ones I haven't noticed yet!) I'm definitely open to Pull Requests.