Clippy AI is a simple wrapper around OpenAI Codex. It allows you to send Codex your current file as well as some instructions in plain-text English. It then opens a diff view in your editor so you can easily see the suggested changes and accept or reject them.
Clippy is free to use for the moment, because it rely's on OpenAI's new edit endpoint which is currently free while in testing. Once OpenAI moves that endpoint into production it'll likely move to a pay-per-usage model like OpenAI's other offerings.
How it Works
Just type what you want Codex to do, and get a diff back with Codex's proposed changes. A GIF is worth a thousand words:
Install this extension from the VS Code Marketplace
Open the command palette (eg. cmd+shift+P on the mac). Search for the new command "Clippy AI: edit file or selection". (Alternatively, we bind the "cmd+;" keyboard shortcut by default.)
When you run the command, an input box will pop up. In plain english, type the instruction you want Clippy to perform. Clippy will send your current file and the instruction to OpenAI's "edit" endpoint and attempt to make the change to the current file. (Note that unlike Github Copilot, Clippy currently only sends the current file, not other files in your workspace.)
If no likely edit is possible, Clippy will show an error message. Otherwise, you'll see Clippy's suggested edits appear in a few seconds in a diff view.
Edits can also be performed on selections; simply select some text before running Clippy to run in this mode.
Using Voice Commands
Clippy AI includes experimental functionality to record commands with your voice! Note that this is highly experimental, and may not work on your machine. It has only been tested on MacOS. If you try this and nothing happens, open an issue and I'll take a look.
Steps to enable:
It may take some time to learn what Clippy is good and bad at. Here are some examples that have worked for me:
"Add types hints to all function definitions"
"Fix all syntax errors"
"Remove commented-out code"
"Remove dead code"
"Add a command to package and install the extension locally"
"Remove all logging statements"#### "Fix types for the edit variable" ^ This one is particularly cool because it highlights Clippy's understanding both of my codebase and the VS Code extension API. I modified my code to require `edits` to handle either a `Selection` or a `Range`, and then used Clippy to fix the types of `edits`. I expected it to change the type to `vscode.Selection | vscode.Range`, but Clippy actually correctly realized that `vscode.Selection` is a subclass of `vscode.Range`, so `vscode.Range` is sufficient on its own!