A Visual Studio Code extension that lets you chat with Azure OpenAI (ChatGPT) directly from your editor!
- Chat Window: Interact with Azure OpenAI’s ChatGPT in a Webview panel.
- Customizable Settings: Configure your Azure endpoint, API key, deployment name, and more in VS Code settings.
- Easy to Use: Just open the command palette and start chatting!
- Node.js (v14+ recommended)
- npm (bundled with Node.js) or Yarn
- Visual Studio Code (v1.76.0 or later)
- Azure OpenAI account with a deployed ChatGPT model (e.g.
gpt-3.5-turboorgpt-4)
-
Clone this repository
git clone https://github.com/<your-username>/<your-repo-name>.git
-
Install dependencies
cd <your-repo-name> npm install
Or use Yarn:
yarn install -
Open in Visual Studio Code
code . -
Set up your Azure OpenAI configuration
In VS Code, go to File > Preferences > Settings (or Code > Preferences > Settings on macOS) and search for Azure ChatGPT (or open yoursettings.jsondirectly).azureChatGPT.endpoint: Your Azure OpenAI endpoint (e.g.https://<YOUR-RESOURCE-NAME>.openai.azure.com/)azureChatGPT.apiKey: Your Azure OpenAI API KeyazureChatGPT.deploymentName: Your ChatGPT model deployment nameazureChatGPT.apiVersion: Azure API version (e.g.2023-03-15-preview)
Note: Store your API key securely if possible (e.g. Secret Storage). The above is for quick testing.
-
Launch the Extension
PressF5in VS Code to open a new Extension Development Host window running your extension. -
Open the Command Palette
- Keyboard shortcut:
- Windows/Linux:
Ctrl + Shift + P - macOS:
Cmd + Shift + P
- Windows/Linux:
- Type “Azure ChatGPT” and select “Open Azure ChatGPT”.
- Keyboard shortcut:
-
Chat
- A webview panel titled “Azure ChatGPT” will appear.
- Type your message or question, then click “Send.”
- Watch for ChatGPT’s response!
-
To create a
.vsixfile:npm run package
This command uses VSCE to bundle your extension into a package you can share or install manually.
-
To publish directly to the Visual Studio Marketplace, you’ll need to set up a publisher and run:
npm run publish
- Fork & Clone this repo.
- Create a new branch for your feature or fix.
- Submit a Pull Request (PR) when ready for review.
This project is licensed under the MIT License.
Enjoy chatting with Azure OpenAI ChatGPT right inside VS Code! If you have any feedback or run into issues, feel free to open an issue. Happy coding!