AI Switcher — VS Code Extension
A unified chat panel to switch between free AI providers without leaving VS Code.
Supported Providers (all free tier)
Setup
1. Install dependencies
npm install
2. Compile
npm run compile
# or watch mode:
npm run watch
3. Run the extension
Press F5 in VS Code to open the Extension Development Host.
4. Add your API keys
Open Settings (Ctrl+,) and search for aiSwitcher, or click the ⚙ Keys button in the panel.
Add keys for whichever providers you want to use:
aiSwitcher.geminiApiKey
aiSwitcher.groqApiKey
aiSwitcher.mistralApiKey
aiSwitcher.cohereApiKey
5. Open the chat
- Run command: AI Switcher: Open Chat from the Command Palette (
Ctrl+Shift+P)
- Or click the chat icon in the editor toolbar
Project Structure
src/
├── extension.ts # Extension entry point
├── panel.ts # Webview panel + message routing
├── providers.ts # API calls for each provider
└── webviewContent.ts # Chat UI HTML/CSS/JS
Extending
Add a new provider
- Add the API key config in
package.json → contributes.configuration.properties
- Add the
callXxx() function in providers.ts
- Add a
case in callProvider() switch
- Add a button in
webviewContent.ts
Publishing
npm install -g @vscode/vsce
vsce package # → ai-switcher-0.0.1.vsix
vsce publish # Publish to VS Code Marketplace
| |