VSModelSwitch
English | 简体中文
VSModelSwitch: an AI CLI provider switcher for VSCode.
VSModelSwitch is a VSCode extension for managing Claude Code and Codex providers, API endpoints, API keys, and models from a side-bar UI. It is built for AI coding users who frequently switch between API gateways, model vendors, proxies, and local test environments.
Features
- Manage Claude Code and Codex providers separately
- Fetch model lists from provider endpoints
- Choose models from fetched lists instead of typing model names manually
- Show each provider as one compact row with quick
Apply
- Refresh and change the model for each provider
- Show separate Claude and Codex provider/model status items in the VSCode status bar
- Watch config file changes and refresh status automatically
- Store API keys locally with VSCode SecretStorage
- Sync provider metadata with VSCode account sync
- Show
Key missing and Set Key for synced providers without local secrets
- Import and export public config without secrets
- Write the active provider to real Claude Code and Codex config files by default
- Optional sandbox mode for safe testing
Config Writes
By default, VSModelSwitch writes active providers to your real machine config files:
~/.claude/settings.json
~/.codex/config.toml
For safe testing, switch to sandbox mode:
{
"vsmodelswitch.configTarget": "sandbox"
}
Sandbox mode writes to:
<workspace>/.vsmodelswitch-home
Local Development
Install dependencies:
npm install
Compile:
npm run compile
Run in VSCode:
- Open this folder in VSCode.
- Press
F5.
- In the Extension Development Host window, click the VSModelSwitch Activity Bar icon.
- Add a Claude Code or Codex provider.
- Click
Fetch Models.
- Choose a model and save.
- Click
Apply on a provider row.
See docs/validation.md for the full local validation checklist.
Mock Endpoint
Start the mock model server:
npm run mock:models
Use this endpoint for both Claude Code and Codex during testing:
http://localhost:8787
Use any non-empty key, for example:
test-key
Settings
{
"vsmodelswitch.globalCliSync": true,
"vsmodelswitch.configTarget": "real",
"vsmodelswitch.testHome": "",
"vsmodelswitch.anthropicVersion": "2023-06-01"
}
Packaging
npm run package
Notes
The status bar is based on the currently readable config files and matches saved providers by baseUrl + model. If another VSCode extension changes a model only in runtime memory without writing a config file or exposing a readable API, VSModelSwitch cannot reliably read that in-memory state.
License
MIT