MCPcopy
hub / github.com/gencay/vscode-chatgpt

github.com/gencay/vscode-chatgpt @v3.9.6 sqlite

repository ↗ · DeepWiki ↗ · release v3.9.6 ↗
15 symbols 38 edges 6 files 1 documented · 7%
README

Ask ChatGPT

ChatGPT, GPT-3 and Codex conversations in Visual Studio Code

<a href="https://discord.gg/GuEdNDHQaM" title="Join Discord">
    <img src="https://discordapp.com/api/guilds/1081195390734438510/widget.png?style=shield" />
</a>
<a href="https://marketplace.visualstudio.com/items?itemName=gencay.vscode-chatgpt" alt="Marketplace version">
    <img src="https://img.shields.io/visual-studio-marketplace/v/gencay.vscode-chatgpt?color=orange&label=VS%20Code%20Marketplace" />
</a>
<a href="https://marketplace.visualstudio.com/items?itemName=gencay.vscode-chatgpt" alt="Marketplace download count">
    <img src="https://img.shields.io/visual-studio-marketplace/d/gencay.vscode-chatgpt?color=blueviolet&label=Downloads" />
</a>
<a href="https://github.com/gencay/vscode-chatgpt" alt="Github star count">
    <img src="https://img.shields.io/github/stars/gencay/vscode-chatgpt?color=blue&label=Github%20Stars" />
</a>

Testimonials

❄️ Featured by Snowflake on Medium blogpost

🎌 Blogpost VSCode に ChatGPT の拡張機能を入れてコードレビューやバグを発見してもらう

💙 Reviews on Twitter

❤️ ChatGPT the pair programmer - VS Code on Youtube

💙 Generative AI on LinkedIn

ChatGPT as your copilot to level up your developer experience

  • ➕ ChatGPT Turbo support with GPT3.5 models
  • 📃 ChatGPT web conversation history within VS Code. Switch between past conversations, continue them, or export all conversations to markdown.
  • 🔥 Streaming conversation support for both browser and API Key method. Stop the response to save your tokens.
  • 📝 Create files/projects or fix your code with one click or with keyboard shortcuts.
  • 🤖 Zero-Config setup. Simply login to OpenAI as usual. Or use OpenAI's official GPT3 APIs.
  • ➡️ Export all your conversation history at once in Markdown format.

📢 Announcements - ChatGPT Plus GPT-4 is now available via Browser autologin

🍀 ChatGPT Plus GPT-4 is now available via Browser autologin

  • You can now use the GPT-4 via your ChatGPT Plus subscription on web using Browser autologin method

    GPT-4 is only available on browser.

🚀 Official ChatGPT API / GPT 3.5 Turbo support

  • You can now use the following official ChatGPT APIs from OpenAI:
  • "OpenAI API Key - gpt-3.5-turbo"
  • "OpenAI API Key - gpt-3.5-turbo-0301"
  • 'gpt-3.5-turbo' model is now the default model used.
  • Make sure to update your model setting in your 'settings.json' if you previously used a different model.

✋ Stop generating feature + Disabling autoscroll

  • Added stop generating responses feature.
  • You can now stop GPT to generate new tokens to save tokens if the response is too long.
  • Improved Codex support.
  • Added a new context menu item when a code- model is selected: ChatGPT-Codex: Generate code
  • Use ctrl+shift+a or cmd+shift+a to ask GPT to generate code 👆
  • Added a new setting to disable automatic scrolling of the responses as ChatGPT responds.

💬💬 Access all of your ChatGPT conversation history

  • You can view top 50 recent conversations
  • Continue or switch between conversations easily
  • NOTE: this is only available if you use the extension with Browser Auto-login method.

Keybindings, new custom prompts and enable/disable prompts

  • You can now use/customize keybindings for your prompts. (i.e. Use cmd+k cmd+shift+1 to run ChatGPT: Add Tests on the selected code on MacOS)
  • You can now enable/disable prompts that you wish to see in the editor's context menus.
  • There are 2 new prompts that you can customize and enable if the currently available prompts are insufficient for your use case.

Get Started

  1. Use OpenAI API key integration - Use your personal/organizational API Keys. This method provides many parameters to customize your prompt. Check out the GPT3 settings. For more details how to set it up: GPT3 OpenAI API Key. See below for the models available today:
Available model Description Max token Knowledge
gpt-3.5-turbo Most capable GPT-3.5 model and optimized for chat at 1/10th the cost of text-davinci-003. Will be updated with our latest model iteration. 4,096 Sep 2021
gpt-3.5-turbo-0301 Snapshot of gpt-3.5-turbo from March 1st 2023. Unlike gpt-3.5-turbo, this model will not receive updates, and will only be supported for a three month period ending on June 1st 2023. 4,096 Sep 2021
text-davinci-003 Can do any language task with better quality, longer output, and consistent instruction-following than the curie, babbage, or ada models. 4,000 Jun 2021
text-davinci-002 Similar capabilities to text-davinci-003 but trained with supervised fine-tuning instead of reinforcement learning 4,000 Jun 2021
code-davinci-002 Optimized for code-completion tasks 4,000 Jun 2021
code-cushman-001 Almost as capable as Davinci Codex, but slightly faster. This speed advantage may make it preferable for real-time applications. 2,048
  1. Use browser integration - Uses browser to ask questions to ChatGPT. Zero-Config Autologin lets the extension grab the required tokens automatically using puppeteer. The extension will use the browser behind the scenes, so you are not expected to receive 4xx errors while asking ChatGPT via extension unless there is OpenAI outages. Autologin Setup (Default)
Available model Description
text-davinci-002-render-sha The default ChatGPT web model.
text-davinci-002-render-paid The Turbo ChatGPT web model. You need an OpenAI Plus subscription for this. Learn more .

API Key Setup

Get your API Key ready from here: OpenAI

  1. Click Login in your extension or ask any coding question by selecting a code fragment.
  2. Once asked provide your API Key to the extension
  3. [Optional] You could also store your API Key in your settings.json. However, it's highly discouraged due to security reasons.

Browser Setup

❕ Please do not interrupt the autologin flow and do not close the browser. Let the extension log you in and the browser will be minimized automatically. ➕ Magic Links with ChatGPT Plus subscriptions should be opened on the same tab the extension is opening. Do not click it from your email. Just copy and paste it into the same browser extension is using.

🚀 All you need to do is click Login or ask a question to get started!

  1. Click on the ChatGPT extension icon on your sidebar and hit Login button.

  2. A new browser window (Default is Chrome but you may override it with any Chromium-based browser) will open up redirected to https://chat.openai.com/. Wait till you see login page, and click on Login on your browser.

  3. If you see a ChatGPT is at capacity right now message, the extension will refresh the page every 2 seconds until it's passed. If OpenAI systems are experiencing issues and the extension fails to see Login page after 10 retries, the browser will be automatically closed.

  4. If you are ChatGPT Plus subscriber, you may enter your email address to receive a Magic Link. Open that link in the same tab that the extension opens for Browser auto-login. Do not click on it from your email, since clicking will deactivate it and you will need to request a new link. This is required for the extension to be able to use the browser it opened for asking questions to ChatGPT.

  5. Solve captchas if you are prompted and continue.

  6. After successfully logging in, the browser will be minimized.

🔑 Use Google, Microsoft or standard OpenAI credentials to login. The email/password will be used to autofill the login form depending on the authentication type you choose. NOTE: We don't recommend storing your password in your settings.json since the file is plain text. However, you can opt-in to use it to reduce the friction during logins.

❗ You will need to have the browser open and be logged in at all times. If you close the browser or your VS-Code instance, you will be asked to login again in your next session.

📝 You can have the extension auto-fill the email address and/or password during logins. Update the extension settings with those information for quicker login. NOTE: We never store any of this information locally or remotely.

🤖 Below is a sample autologin flow. Simply login & keep your browser minimized for dialogues with ChatGPT:


Features

The extension comes with context menu commands, copy/move suggested code into editor with one-click, conversation window and customization options for OpenAI's ChatGPT prompts.

ChatGPT Conversation History

  • Use Browser Auto-login method to access all of your ChatGPT conversations.
  • Either from the home page or the kebab menu, click Show conversations.
  • Select a conversation to load.
  • You can continue the conversation or move to another conversation easily.
  • A timestamp for when the chat was created along with its title will be displayed on the top of the window.

📤 Export all your conversation history with one click


Ad-hoc prompt prefixes for you to customize what you are asking ChatGPT

Customize what you are asking with the selected code. The extension will remember your prompt for subsequent questions.


Automatic partial code response detection

The extension will detect if ChatGPT didn't complete code in their answer and it will suggest automatic continuation and combination of answers


🍻 Optimized for dialogue


Edit and resend a previous prompt


Copy or insert the code ChatGPT is suggesting right into your editor.


Custom prompts

  • You can enable/disable all of your context menu items. Simply go to settings and find the prompt that you would like to disable. Custom prompts are hidden by default.
  • ChatGPT: Ad-hoc prompt: Ad-hoc custom prompt prefix for the selected code. Right click on a selected block of code, run command.
  • You will be asked to fill in your preferred custom prefix and the extension will remember that string for your subsequent ad-hoc queries.
  • ChatGPT: Add tests: Write tests for you. Right click on a selected block of code, run command.
  • "default": "Implement tests for the following code",
  • "description": "The prompt prefix used for adding tests for the selected code"
  • ChatGPT: Find bugs: Analyze and find bugs in your code. Right click on a selected block of code, run command.
  • "default": "Find problems with the following code",
  • "description": "The prompt prefix used for finding problems for the selected code"
  • ChatGPT: Optimize: Add suggestions to your code to improve. Right click on a selected block of code, run command.
  • "default": "Optimize the following code",
  • "description": "The prompt prefix used for optimizing the selected code"
  • ChatGPT: Explain: Explain the selected code. Right click on a selected block of code, run command.
  • "default": "Explain the following code",
  • "de

Core symbols most depended-on inside this repo

sendMessage
called by 8
src/chatgpt-view-provider.ts
sendApiRequest
called by 3
src/chatgpt-view-provider.ts
addFreeTextQuestion
called by 2
media/main.js
clearConversation
called by 2
media/main.js
exportConversation
called by 2
media/main.js
prepareConversation
called by 2
src/chatgpt-view-provider.ts
getWebviewHtml
called by 1
src/chatgpt-view-provider.ts
main
called by 1
src/test/runTest.ts

Shape

Function 7
Method 6
Class 2

Languages

TypeScript100%

Modules by API surface

src/chatgpt-view-provider.ts8 symbols
media/main.js3 symbols
src/extension.ts2 symbols
src/test/suite/index.ts1 symbols
src/test/runTest.ts1 symbols

Dependencies from manifests, versioned

@types/glob8.0.0 · 1×
@types/mocha10.0.1 · 1×
@types/node16.x · 1×
@types/vscode1.73.0 · 1×
@types/vscode-webview1.57.0 · 1×
@typescript-eslint/eslint-plugin5.45.0 · 1×
@typescript-eslint/parser5.45.0 · 1×
@vscode/test-electron2.2.0 · 1×
chatgpt2.0.7 · 1×
esbuild0.15.18 · 1×
eslint8.28.0 · 1×
glob8.0.3 · 1×

For agents

$ claude mcp add vscode-chatgpt \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact