Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>CodeGenie GPT4New to Visual Studio Code? Get it now.
CodeGenie GPT4

CodeGenie GPT4

Arlen Stalwick

|
3,700 installs
| (2) | Free
CodeGenie: Your ChatGPT-powered coding assistant. With seamless integration into your editor, quickly turn questions into code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

CodeGenie

Supercharge your coding with CodeGenie - the free development tool that brings ChatGPT straight to your editor. Streamline your workflow with Refactor, Comment Code, Code Review, and Ask a Question commands, all within your CodeGenie panel. Imagine the power of chat.openai.com, but with seamless editor integration.

While you're here, consider checking out DataDocs.ai, a service that uses LLMs to generate and maintain database documentation for you.

UPDATE (February 10):

  • Added support for gpt-4-turbo-preview (128k token support).
  • Added ability to delete messages within the chat history

CodeGenie demo

Feature Overview

  • Seamlessly copy code from editor to chat and vice versa, at the click of a button
  • Switch between previous chats with ease, thanks to saved chat history on disk
  • Take advantage of the latest AI LLM models: GPT 3.5 or GPT 4 (including the longer-history variants)
  • You're in control: Default prompts are fully configurable, including the system prompt
  • Easily regenerate an individual response using any of the GPT models.
  • Easy access to CodeGenie commands through Command Palette and Context Menu integration )

Getting Started

0. Install CodeGenie

Goes without saying, no? You can do that in the VSCode Extension Marketplace, or in VSCode's extension panel itself.

1. Get an OpenAI API token

CodeGenie requires a valid OpenAI API token. If you haven't already got an OpenAI account, create one here: OpenAI Platform.

Once you've created your account, you need to create an API token for CodeGenie to use. Navigate to the View API Keys page, and then create yourself a new API key. Copy that to the clipboard and hop over to VSCode.

In VSCode, Ctrl/Cmd-Shift-P to open the command palette and select 'CodeGenie: Set OpenAI API Key'. You'll be prompted to enter your API key. Once you do, your token is validated and you're good to go.

IMPORTANT: Your API key never leaves your computer (except to communicate with OpenAI). It is stored directly in VSCode's secure secret storage .

2. Enjoy!

CodeGenie is designed to run in a panel beside your code. To activate CodeGenie and see the commands available, just hit Ctrl/Cmd-Shift-P and type 'CodeGenie,' or right-click in any editor window. You'll see some commands like:

  • CodeGenie: Ask a Question
  • CodeGenie: Refactor Code
  • CodeGenie: Comment Code
  • CodeGenie: Code Review
  • CodeGenie: Explain Code

When you select one of those commands, it will open a CodeGenie panel and populate the message area with the code you've selected and the command prompt. Feel free to modify to suit your needs, and then hit enter to send your message off to ChatGPT.

Features

Quick and easy bi-directional code insertion

When you're using ChatGPT, you'll often want to provide it some code. With CodeGenie open, you can just highlight your code in an editor and then click the '>' button beside the message input. That will toss your code into the prompt input so that you can ask your question.

CodeGenie insert into chat gif

When ChatGPT responds, CodeGenie parses the response into markdown and syntax-highlighted code blocks. Every code block in the response also include a '<' button. When you click that, the code from the response will be inserted into the editor at your cursor (and will replace any selection).

CodeGenie insert into editor gif

Use GPT 4, GPT 3.5 or any of the longer-context variants

CodeGenie stores your chats on disk (associated with your workspace), and automatically resumes them. You can have multiple chats and easily switch from one to another.

Command Palette and Context Menu support

There are two ways to activate CodeGenie: using the VSCode Command Palette (cmd-shift-p, then type 'CodeGenie'), or using the context menu (right-click) in any editor window.

Persistent Chat History

CodeGenie stores your chats on disk (associated with your workspace), and automatically resumes them. You can have multiple chats and easily switch from one to another.

Relatively Sane (and Configurable!) Default Prompts

You could just manually ask ChatGPT whatever you want using the 'CodeGenie: Ask a Question' command. However, CodeGenie also supplies baked-in prompts for common tasks.

  • Explain Code
  • Refactor Code
  • Comment Code
  • Code Review

If you find that the default prompts for these commands aren't exactly what you like, hop over to CodeGenie's extension settings to modify them.

CodeGenie settings

CONTACT

E-mail me: arlen@nsono.net if you have any issues.

See CHANGELOG for release notes


  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft