Git Product home page Git Product logo

vscode-chatgpt-reborn's Introduction

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

Format the code using Prettier and run tests with fixes

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:

  1. Open the project directory in Visual Studio Code.

  2. Press F5 or click Run > Start Debugging in the menu to start a new Extension Development Host instance with the extension loaded.

  3. In the Extension Development Host instance, test the extension's functionality.

  4. Use the Debug Console in the main Visual Studio Code window to view any output or errors.

  5. 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.

  6. Once you are satisfied with your changes, submit a pull request to the original repository.

TODO

  • 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

Internationalization

Initial i18n support has been added in v3.15.0, but I need help translating to different languages. If you're able to help at all see this discussion.

Proxy

This extension can be used with a proxy if you put the proxy's URL path in the "Api Base Url" config setting.

Update 4.8.2023 - I've set up a proxy for anyone that needs it at https://openai-proxy.dev/v1. It's running x-dr/chatgptProxyAPI code on CloudFlare Workers.

Tech

Yarn - TypeScript - VSCode Extension API - React - Redux - React Router - Tailwind CSS

  • The UI is built with TailwindCSS. But, respecting VSCode's UI consistency and theme support is still a priority.
  • This does not use VSCode's WebView UI Toolkit. But, I'm open to switching to the WebView UI toolkit since it better aligns with VSCode's UI.

License

This project is licensed under the ISC License - see the LICENSE file for details.

Changelog

May 30, 2023 (v3.16.5)

  • ๐Ÿ”ง [Fixes] Onboarding - Fix api key verification issue relating to the api url config setting. - Thanks for the PR @zzy-life

May 19, 2023 (v3.16.4)

  • ๐Ÿ”ง [Fixes] Onboarding - Fix api key verification not working with proxy api endpoints.

May 9, 2023 (v3.16.3)

  • ๐ŸŒ [i18n] Translation file refactor to work more predictably. Right-click menu is now translated. - Thanks for the PR @zzy-life
  • ๐Ÿ”ง [Fixes] Expanded the VSCode support to version v1.70.0 (July 2022). Previously it was to v1.73.0 (October 2022). Can lower more if needed. - Thanks for the bug report @zzy-life
  • ๐Ÿ–ฅ๏ธ [UI] Text about this being a fork has been removed since it's no longer really needed, and clutters the UI. - Thanks for the suggestion @danyalaytekin

April 8, 2023 (v3.16.1)

  • ๐Ÿ”ง [Fixes] Using a proxy causes "unexpected end of JSON" error. - Thanks for the bug report @lvii
  • ๐Ÿ–ฅ๏ธ [UI] Made error messages a little more helpful.

April 3, 2023 (v3.15.2, v3.16.0)

  • ๐Ÿ–ฅ๏ธ [UI] "Actions" page added. A couple actions are available, more will be added in the future. Automate your workflow with AI!
  • ๐Ÿ–ฅ๏ธ [UI] Codeblock buttons are now sticky.
  • ๐Ÿ–ฅ๏ธ [UI] UI fixes for light themes.
  • ๐Ÿ–ฅ๏ธ [UI] Token breakdown now warns about gpt-4 pricing.

March 30, 2023 (v3.15.0, v3.15.1)

  • ๐ŸŒ [i18n] Initial i18n support, localization is still a work in progress.
  • ๐Ÿ”ง [Fixes] Fix 404 error due to invalid API base URL. - Thanks for the bug report @hakula139

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. - Thanks for the bug report @PeterDaveHello
  • ๐Ÿ”ฉ [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. - Thanks for the feature request @flutterrausch
  • ๐Ÿ–ฅ๏ธ [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.

vscode-chatgpt-reborn's People

Contributors

christopher-hayes avatar zzy-life avatar gencay avatar erezak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.