OR-CLI for VS CodeAI coding assistant powered by OpenRouter — access 400+ models (GPT-4o, Claude, Gemini, Mistral, DeepSeek and more) directly in VS Code. The CLI and VS Code extension are released together and share the same version. Current version: Built by Swatto. FeaturesBuilt-in chat (
|
| Tool | What it does |
|---|---|
vscode_get_active_file |
Reads the file currently open in the editor |
vscode_get_selection |
Reads highlighted text and its line range |
vscode_get_diagnostics |
Reads errors/warnings from the Problems panel |
vscode_get_workspace_info |
Workspace roots, git branch, active language |
vscode_search_workspace |
File and text search across the workspace |
vscode_apply_edit |
Applies multi-file changes with a diff preview |
vscode_open_file |
Opens a file at a specific line |
vscode_run_task |
Executes a defined VS Code task |
Standard tools are also available: read_file, write_file (with diff preview + undo-safe WorkspaceEdit), execute_shell_command, git_diff, git_commit, web_search, and more.
Diff preview for file writes
When the AI writes a file you see a native VS Code diff editor — Apply or Discard before anything touches disk. All applies go through WorkspaceEdit so they participate in the undo stack.
"Fix with OR-CLI" quick fix
Errors and warnings in the Problems panel get an OR-CLI quick-fix action. Click it to open a pre-populated chat with the diagnostic, file context, and surrounding code already loaded.
"Ask AI" code lens
Opt-in Ask AI actions above every function, method, and class definition. Enable with orcli.codeLens.enable.
Right-click menu
- Ask About This File — sends the full file content to chat
- Ask About Selection — sends highlighted code to chat
Session management
Sessions are saved automatically after each turn and listed in the Sessions sidebar. Rename, delete, or reload any previous conversation.
Manual model IDs
Use OR-CLI: Change Model to browse the live OpenRouter model list or type an exact model ID manually. The sidebar also accepts /model <model-id>, and the settings panel includes a manual model field for models that are not in the browser list yet.
MCP server support
If you have an ~/.openrouter/mcp-config.json, configured MCP servers connect automatically and their tools are available to the AI alongside the built-in tools.
Getting started
- Install the extension
- Open the OR-CLI panel from the activity bar (robot icon)
- Run OR-CLI: Set API Key from the command palette and paste your OpenRouter API key
- Start chatting
Configuration
Core
| Setting | Default | Description |
|---|---|---|
orcli.model |
openrouter/pareto-code |
Default model |
orcli.temperature |
0.7 |
Sampling temperature (0–2) |
orcli.maxToolRounds |
10 |
Max tool-call rounds per message |
orcli.showToolOutput |
true |
Show tool output in the OR-CLI output channel |
orcli.codeLens.enable |
false |
Show "Ask AI" above functions and classes |
orcli.yoloMode |
false |
Auto-approve all permission prompts (shell commands, file writes, etc.) |
Model routing
| Setting | Default | Description |
|---|---|---|
orcli.reasoningEffort |
none |
Reasoning budget for extended-thinking models: none · minimal · low · medium · high · xhigh |
orcli.preferFree |
false |
Append :free to the model ID for free-tier routing |
orcli.preferNitro |
false |
Append :nitro to the model ID for speed-priority routing |
orcli.optimizeMode |
none |
OpenRouter optimisation: none · speed · cost · quality |
orcli.fallbackModels |
[] |
Fallback model IDs tried in order if the primary model fails |
Pareto Router
| Setting | Default | Description |
|---|---|---|
orcli.pareto.enabled |
true |
Enable intelligent coding-task routing via Pareto Router |
orcli.pareto.minCodingScore |
0.8 |
Only consider models with a coding score above this threshold (0–1) |
orcli.pareto.variant |
default |
default for balanced routing, nitro for speed-optimised routing |
Provider routing
| Setting | Default | Description |
|---|---|---|
orcli.provider.order |
[] |
Preferred provider order, e.g. ["Anthropic", "OpenAI"] |
orcli.provider.only |
[] |
Restrict requests to only these providers |
orcli.provider.ignore |
[] |
Never use these providers |
orcli.provider.sort |
none |
Sort providers by price · throughput · latency |
orcli.provider.allowFallbacks |
true |
Allow fallback when the preferred provider is unavailable |
orcli.provider.requireParameters |
false |
Only route to providers that support all requested parameters |
orcli.provider.dataCollection |
none |
deny excludes providers that collect data for model training |
orcli.provider.zdr |
false |
Require Zero Data Retention endpoints |
Commands
| Command | Description |
|---|---|
OR-CLI: Set API Key |
Store your OpenRouter API key securely |
OR-CLI: Change Model |
Pick from the live model list with pricing or type an exact model ID |
OR-CLI: New Session |
Start a fresh conversation |
OR-CLI: Ask About This File |
Send the active file to chat |
OR-CLI: Ask About Selection |
Send selected code to chat |
OR-CLI: Fix with AI |
Fix the diagnostic under the cursor |
OR-CLI: Load Session |
Load a saved session into the chat panel |
OR-CLI: Delete Session |
Permanently delete a saved session |
OR-CLI: Rename Session |
Rename the current session |
OR-CLI: Export Session to Markdown |
Export the current session as a Markdown file |
OR-CLI: Show Balance |
Show your live OpenRouter account balance |
OR-CLI: Compare Models on Last Prompt |
Re-run the last prompt on a second model for comparison |
OR-CLI: Set Reasoning Effort |
Set the reasoning effort level for extended-thinking models |
OR-CLI: Toggle Prefer Free Models |
Toggle free-tier routing for the current model |
OR-CLI: Set Optimize Mode |
Set the OpenRouter optimisation mode |
OR-CLI: Open Settings |
Open the OR-CLI settings panel |
OR-CLI: Toggle Yolo Mode (Auto-approve All Permissions) |
Toggle auto-approval of all permission prompts |
Build VSIX
npm install
npm run typecheck
npm run build
npm run package
The package command creates orcli-vscode-1.0.24.vsix.
Publish to Marketplace
Publishing is automated by .github/workflows/publish-vscode-extension.yml.
- Create a Marketplace Personal Access Token for the
Swattopublisher with Marketplace manage permission. - Add it to GitHub repository secrets as
VSCE_PAT. - Push a release tag such as
v1.0.24, or run the Publish VS Code Extension workflow manually from GitHub Actions.
The workflow runs typecheck, build, packages the VSIX, then publishes that VSIX to the Visual Studio Marketplace.
MCP server configuration
Create ~/.openrouter/mcp-config.json:
{
"mcpServers": {
"my-server": {
"command": "npx",
"args": ["-y", "@my-org/mcp-server"]
},
"remote-server": {
"url": "https://my-server.example.com/sse"
}
}
}
MCP tools appear automatically in the next chat session.
Links
- OpenRouter — model provider
- OR-CLI GitHub — source and issue tracker
- OpenRouter API keys
Built by Swatto