Repolode
ai-genie

ai-genie/chatgpt-vscode

A VS Code extension that lets you send code questions, explanations, tests and fixes to OpenAI models from inside the editor.

Open-source alternative to:GitHub Copilot Chat

Stars
1,272
Forks
85
Open issues
116
Last commit
30 days ago

What is it?

ChatGPT VS Code (Genie) is an editor extension that connects Visual Studio Code to OpenAI's GPT-4, GPT-3.5, GPT-3 and Codex models. Users select a code fragment and run commands from the context menu to explain, optimize, find bugs in, comment on or generate tests for that code, with answers streamed into the editor or a sidebar conversation window.

The extension also works with compile-time errors in the Problems window, offering quick fixes through the lightbulb menu, and it shows a diff between the user's code and the suggested change so it can be applied with one click. It can generate git commit messages from staged changes, and it supports Azure OpenAI Service deployments through a configurable URL. Users provide their own OpenAI or Azure API key, which is stored in VS Code's secret storage.

Conversation history can optionally be saved to disk using VS Code's global storage API, and the full history can be exported as Markdown. Prompt prefixes, the system message and the assistant name are all configurable in settings.

Key features

  • 01Context menu commands to explain, optimize, test, comment on and find bugs in selected code.
  • 02Streaming answers in the editor or a sidebar conversation window.
  • 03Quick fixes for Problems-window errors, with a diff view to apply suggestions.
  • 04Commit message generation from git changes.
  • 05Support for OpenAI API keys and Azure OpenAI Service deployments.
  • 06Optional local conversation history with Markdown export.

Use cases

  • Getting an explanation of an unfamiliar code block without leaving the editor.
  • Generating unit tests or comments for selected functions.
  • Fixing compile-time errors flagged in the Problems window.
  • Drafting git commit messages from pending changes.

Quick start

  1. 1

    Install the extension from the VS Code Marketplace

  2. 2

    Select a code fragment and ask a question, then enter your OpenAI API key when prompted

Things to know

  • Requires your own OpenAI API key, and usage is billed by OpenAI.
  • Conversation history is an experimental feature that may have bugs.
  • Some newer models such as o1-mini and o1-preview have usage tier limits.

In collections

Topics

FAQ

What is chatgpt-vscode?
A VS Code extension that lets you send code questions, explanations, tests and fixes to OpenAI models from inside the editor. ChatGPT VS Code (Genie) is an editor extension that connects Visual Studio Code to OpenAI's GPT-4, GPT-3.5, GPT-3 and Codex models. Users select a code fragment and run commands from the context menu to explain, optimize, find bugs in, comment on or generate tests for that code, with answers streamed into the editor or a sidebar conversation window.
Is chatgpt-vscode free to use? What license does it have?
chatgpt-vscode is open source under the ISC license. Check the license terms before using it in commercial products.
Is chatgpt-vscode still maintained?
Actively maintained. The last commit to chatgpt-vscode was on Oct 8, 2026.
What can I use chatgpt-vscode for?
Getting an explanation of an unfamiliar code block without leaving the editor. Generating unit tests or comments for selected functions. Fixing compile-time errors flagged in the Problems window. Drafting git commit messages from pending changes.
How do I install chatgpt-vscode?
Install the extension from the VS Code Marketplace Select a code fragment and ask a question, then enter your OpenAI API key when prompted
Where can I get chatgpt-vscode?
The source code and installation instructions are on GitHub: https://github.com/ai-genie/chatgpt-vscode

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects