ChatGPT Reborn
ChatGPT Reborn is a Visual Studio Code extension that allows you to use the ChatGPT API to write, refactor, and improve your code.
Get for VSCode
Search for "ChatGPT Reborn" in the VSCode extension search.
Or install directly:
Or build this extension yourself (see below).
About this fork
This is a fork of the popular, but now discontinued vscode-chatgpt extension. Full credit to @gencay for building the original extension and open-sourcing it. Note that this version is API-only, the browser code was not open-sourced by Gencay (due to OpenAI ToS issue).
The new "ChatGPT: Genie AI" extension
Gencay has released a new extension, "ChatGPT: Genie AI", that is a continuation of his work in an API-only format: https://github.com/ai-genie/chatgpt-vscode
What does that mean for this fork?
I will be continuing work on this extension, I have some ideas for features that focus on automation. Please understand that this means there are fairly major changes on the horizon in the name of a better dev experience. I suggest building from gencay/vscode-gencay source if you do not want an extension that may occasionally break as it evolves.
FOSS
As a FOSS advocate, I feel compelled to note that Genie AI is not open-source and it sounds (to me at least) like it may at some point have paid features. I don't have a personal issue with that, it will allow the Genie AI team to spend more time improving their extension. But, you can expect "Reborn" to stay FOSS, and if you're a fan of open-source - feedback, issues, and PRs are welcome.
GPT-4
Required - You must have access to GPT-4 via API. OpenAI's waitlist for GPT-4 API access is here: https://openai.com/waitlist/gpt-4-api
If you're part of an organization account that has GPT-4 access, be sure to set the Organization ID
. (This will also charge the organization account). If you're wondering about the 32,000 token version of GPT-4, OpenAI hasn't made that model available yet.
Installation
To set up the project, first clone the repository:
git clone https://github.com/christopher-hayes/vscode-chatgpt-reborn.git
Next, change into the project directory and install the dependencies using Yarn:
cd vscode-chatgpt-reborn
yarn install
Running Scripts
You can run the following scripts using Yarn:
Build the extension
yarn run build
Watch for changes and rebuild automatically
yarn run watch
yarn run fmt
Run tests using ESLint and TypeScript
yarn run test
Testing the Extension in Visual Studio Code
To test the vscode-chatgpt-reborn extension in Visual Studio Code, follow these steps:
Open the project directory in Visual Studio Code.
Press F5
or click Run > Start Debugging
in the menu to start a new Extension Development Host instance with the extension loaded.
In the Extension Development Host instance, test the extension's functionality.
Use the Debug Console in the main Visual Studio Code window to view any output or errors.
If you need to make changes to the extension, stop the Extension Development Host, make the changes, and then start the Extension Development Host again.
Once you are satisfied with your changes, submit a pull request to the original repository.
TODO
- [x] Publish to VSCode Marketplace.
- [x] Add model dropdown to ChatGPT UI.
- [x] Allow more custom prompts.
- [x] Add setting for a custom system message.
- [x] Move API key from settings config to secure storage.
- [x] Use API list API to show user what models they have access to.
- [ ] Improve language localization.
- [ ] Add way to manage custom prompts in UI.
- [ ] Add option to stream directly into the editor.
- [ ] Inline diff
- [ ] "Smart" actions based on the type of file open.
- [ ] "Smart" actions on that run at a project level.
- [ ] AI-generated git commit messages
- [ ] Support davinci models in place of ChatGPT models
Tech
License
This project is licensed under the ISC License - see the LICENSE file for details.
Changelog
March 28, 2023 (v3.14.0
)
- 🖥️ [UI] Add token count UI
- 🖥️ [UI] "Clear" button added for clearning the conversation. Highly recommend using it to avoid expensive token usage with long conversations.
- 🖥️ [UI] Minor tweaks to mini buttons below input box to prefer wrapping on smaller windows and ui fixes to actions menu on smaller windows.
- 🔧 [Fixes] Token counting issues causing
4096
maxTokens config setting to fail.
- 🔩 [Behind the scenes] API provider refactor. Moving towards using the
OpenAI
library and its SDK for better maintainability. Note that baseUrl
setting should now end in /v1
, which matches OpenAI's SDK for basePath
.
March 26, 2023 (v3.12.0
, v3.12.1
, v3.13.0
, v3.13.1
)
- 🔐 [Security] API key is now stored in VSCode secure storage. It will automatically put your API key in secure storage if you have it in your settings config and then remove it from your settings config.
- 🖥️ [UI] Added a "Verbosity" config setting and UI select.
- 🖥️ [UI] User messages will now include a code block if editor text selection is sent.
- 🖥️ [UI] Moved "Feedback", "Settings" and "Export" to "More Actions" menu.
- 🖥️ [UI] New users greeted with a "Getting started" page and API key input.
- 🎮 [QoL] Added "Disable Multiple Conversations" setting.
- 🎮 [QoL] Added "Minimal UI" setting.
- 🔧 [Fixes] Chat now scrolls to the bottom after context menu actions.
- 🔧 [Fixes] Modified default prompt for adding code comments.
- 🔧 [Fixes] Overlapping issues with tooltips fixed.
March 25, 2023 (v3.11.0
- v3.11.5
)
- 🖥️ [UI] General UI look/feel updates. Note that these UI upates have a heavy focus on VSCode's UI guidelines and respecting each theme's color palette.
- 🖥️ [UI] Added multiple chats and model selector.
- 🖥️ [UI] Added a model selector. This will only show the models your API key has access to and links to the GPT-4 waitlist if your key does not have access.
- 🔩 [Behind the scenes] Refactor to use React+Redux for the UI. This will make it easier to build a dynamic UI.
- 🎮 [QoL] Updated scroll behavior. You can now scroll up as code is being generated, or scroll back to the bottom to "re-lock" the auto-scroll.
- 🎮 [QoL] When opening code in a new text editor, VSCode should now automatically know how to syntax highlight it.
- 🎮 [QoL] Configuring "System message" is now an extension setting.