/vscode-chatgpt

A Visual Studio Code extension to support ChatGPT. The extension is pair-programmed with ChatGPT.

Primary LanguageJavaScriptISC LicenseISC


Ask ChatGPT

ChatGPT conversations in Visual Studio Code

Badge for version for Visual Studio Code extension gencay.vscode-chatgpt

ChatGPT as your copilot to level up your developer experience

  • ๐Ÿ†• Export all your conversation history at once.
  • ๐Ÿ†• Option to clear and restart the conversation with ChatGPT.
  • ๐Ÿป Optimized for dialogue! Have a conversation with ChatGPT with follow-ups.
  • ๐Ÿ’ฏ Get help from ChatGPT within vs-code for implementing test cases, explaining it or finding bugs.
  • ๐Ÿ“ Create projects/files with one click using built-in actions in the conversation view.
  • โšก Built-in syntax highlighting for ChatGPT suggested code using the default code-font of your Visual Studio Code!
  • ๐Ÿ–ผ๏ธ Icon is generated by dall-e-2.

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 window in vs-code

๐Ÿ†• Export all your conversation history withs one click


๐Ÿป Optimized for dialogue


Edit and resend a previous prompt


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


Ask free-form text questions that will be listed in the conversation window. The conversation is kept in cache until vs-code instance is closed.


Use defaults or customize your code prompts

  • 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",
    • "description": "The prompt prefix used for explaining the selected code"

Other available commands

  • ChatGPT: Ask anything: Free-form text questions within conversation window.
  • ChatGPT: Clear session: Clears the current session. Useful in case of API errors.
  • ChatGPT: Clear conversation: Clears the conversation window and resets the thread to start a new conversation with ChatGPT
  • ChatGPT: Export conversation: Exports the whole conversation in Markdown for you to easily store and find the Q&A list.

Customization settings

  • You can configure the commands to use any prompts for the selected code!
  • Opt-in to receive notification when ChatGPT sends you a message!

Setup

Follow the instructions here to get your session token: https://github.com/transitive-bullshit/chatgpt-api#session-tokens

During your first interaction with the extension, you will be asked to enter your session token.

Troubleshooting

  • If the bot isn't responding, try clearing your cache by running the ChatGPT: Clear session command.
  • It's possible that openai systems may experience issues responding to your queries due to high-traffic from time to time.
  • If you get ChatGPTAPI error 429, it means that you are making Too Many Requests. Please wait and try again in a few moments

Credits