VishnuBot for VS Code
Your own AI model inside VS Code. Works with any OpenAI-compatible API: OpenAI, Ollama (/v1), LM Studio, vLLM, llama.cpp, or your own server. Nothing goes anywhere except the API you configure.
Features
- Chat panel in the activity bar, with answers streamed as they're written.
- Saved chats: every conversation is kept per workspace. Open Saved chats (☰ or the history icon) to search, switch, rename, export as Markdown, or delete them.
- Sends your open file automatically: the file in the editor (or just your selection) goes along with each message. A chip above the input shows what will be sent; click ✕ to leave it out for one message.
- Never overflows the model: history is trimmed to fit your model's context window (
vishnubot.contextWindow), and older messages are summarised instead of silently dropped. Long tool sessions shrink old tool output automatically.
- Token use and speed under each answer: tokens in/out, tokens per second, time to first token, and a context-window meter.
- Knows your workspace: sees the open file, selection, open tabs and project layout, and can list, search and read files, check VS Code's problems and find symbols.
- Search by meaning: the workspace is indexed in the background, so the model can find code by what it does ("where are users authenticated?") instead of by exact names. Keyword search works out of the box; set
vishnubot.index.embeddingModel (e.g. nomic-embed-text) for meaning-based search too. The index updates as files change and is saved between sessions.
- Plan mode: click 📋 Plan, describe the task, and VishnuBot proposes a step-by-step plan after looking through the code. Nothing changes until you click Run plan; then the steps tick off as it works.
- Review every change in one place: edits are staged while VishnuBot works. When it's done, one card lists every changed file: Review all opens a multi-file diff, then Accept all, Reject all, or decide file by file. Nothing is written until you accept. (Prefer approving each edit as it happens? Set
vishnubot.edits.reviewMode to each.)
- Undo: ↶ Undo changes under an answer puts back every file it changed. If you've edited those files since, you're asked first.
- Git: ✨ in the Source Control title bar writes the commit message in your repository's style. Also Review Uncommitted Changes and Write Pull Request Description.
- MCP tools: connect Model Context Protocol servers (local or remote) and the model can use their tools, asking you before each call unless you auto-approve it.
- Project rules: put team instructions in
.vishnubot/rules.md (or AGENTS.md) and they go with every chat in that repository.
- Runs commands with your approval: the model can run tests, builds and linters to check its work. You approve every command, unless it matches one of your
vishnubot.terminal.autoApprove prefixes (commands with &&, |, ;, redirects or substitutions always ask). Output goes to the VishnuBot Commands output panel.
- Inline completions: ghost-text suggestions as you type (Tab to accept). They use fill-in-the-middle when your server supports it, and fall back to chat otherwise. Turn them on from the VB status bar item. A small code model (
vishnubot.inlineCompletions.model) keeps them fast.
- Lightbulb actions (Ctrl+.): Fix with VishnuBot on errors and warnings, plus Explain, Write tests, Add docs and Refactor for the selection or the function at the cursor. These are also in the editor's right-click VishnuBot menu.
- @vishnubot in VS Code's Chat view, with
/explain, /fix, /tests and /docs. It uses the same model and tools as the panel.
- Saved connections: save several URL/model/key combinations (e.g. "Local Ollama" and "OpenAI") and switch from the status bar in one click.
- Web search with cited sources (DuckDuckGo free, or Google via Serper / Tavily with a key).
- Word and PDF files: ask for "a PDF of …" and VishnuBot creates real files you can open from the chat.
- Attachments: attach the current file, other text/code files, or images (vision models).
- Usage: VishnuBot: Show Usage shows tokens and speed per model and per day.
- Works with VishnuBot desktop: when the desktop app is running, chats and token use are copied to it so its history and Usage page include VS Code, and Open a Chat From the Desktop App… opens desktop chats here.
MCP servers
Open the gear icon → 🔌 MCP servers… (or click 🔌 in the status bar). There you can:
- add a ready-made server (Fetch, Filesystem, Git, GitHub, Memory, Time, Sequential thinking) or your own, local (VishnuBot starts it) or remote (a URL)
- click Test to connect and see its tools before saving
- see each server's status and errors, turn it on or off, edit or delete it
- tick the tools that may run without asking (only harmless ones, e.g. read-only)
Values marked 🔒 (tokens in environment variables or headers) are kept in your system's credential store; settings.json only says ${secret}.
You can also write the setting (vishnubot.mcp.servers) by hand, for example:
"vishnubot.mcp.servers": {
// a local server, started by VishnuBot
"fetch": { "command": "uvx", "args": ["mcp-server-fetch"] },
// a remote server; autoApprove skips the confirmation for these tools
"docs": { "url": "https://example.com/mcp", "headers": { "Authorization": "Bearer …" }, "autoApprove": ["search_docs"] }
}
Servers in the workspace's .vscode/mcp.json (VS Code's format) are used too, but only in a trusted workspace and after you allow each one, since anyone who wrote the repository could have put a command there. VishnuBot: MCP Servers… shows which are connected and how many tools each has.
Setup
- Click the VishnuBot icon in the activity bar.
- The Connection form opens in the panel (later: gear icon). Either click Import from VishnuBot desktop app, or:
Pick a provider card: Ollama, LM Studio, OpenAI, Anthropic, Gemini, or Custom for any other OpenAI-compatible server (vLLM, llama.cpp, OpenRouter...). This fills in the API Base URL:
| Provider |
API Base URL |
Protocol |
| Ollama |
http://localhost:11434/v1 |
OpenAI-compatible |
| LM Studio |
http://localhost:1234/v1 |
OpenAI-compatible |
| OpenAI |
https://api.openai.com/v1 |
OpenAI-compatible |
| Anthropic |
https://api.anthropic.com/v1 |
Anthropic Messages API |
| Gemini |
https://generativelanguage.googleapis.com/v1beta |
Gemini API |
API key, if your API needs one (the form shows whether the chosen provider requires one). Keys are stored in your system's credential store, not in settings.
Model: type it, or click Load models and pick one
- Click Test connection, then Save.
- Set
vishnubot.contextWindow to your model's context size (the default 32768 suits most modern models; Ollama often runs with 4096–8192 unless you raise num_ctx).
- To let VishnuBot work with your project, open the folder in VS Code, then use VishnuBot: Workspace Access… if you want to check workspace status, rebuild the index, or manage workspace trust for
.vscode/mcp.json MCP servers.
Optional:
- Inline completions: click VB in the status bar. With Ollama,
ollama pull qwen2.5-coder:1.5b, then set vishnubot.inlineCompletions.model to it.
- Search by meaning:
ollama pull nomic-embed-text, then set vishnubot.index.embeddingModel to nomic-embed-text. With Gemini, use an embedding model such as text-embedding-004. Anthropic has no embeddings API, so the index stays keyword-only there.
Anthropic and Gemini
Both use their native APIs, with streaming, tool calls (workspace tools, web search, MCP, documents) and images. The protocol is picked from the URL (vishnubot.provider: auto); set it to anthropic or gemini explicitly when a proxy or gateway sits in front of them. Gemini's OpenAI-compatible endpoint (…/v1beta/openai) also works, as openai.
Inline completions use chat prompts with these providers, since neither has a fill-in-the-middle endpoint.
- Saved connections: click the model name in the status bar → Save current connection as….
Settings
| Setting |
Default |
|
vishnubot.apiBaseUrl |
|
OpenAI-compatible base URL |
vishnubot.model |
|
Chat model |
vishnubot.contextWindow |
32768 |
Model context window in tokens; history is fitted to it |
vishnubot.maxTokens |
8192 |
Max tokens per reply |
vishnubot.temperature |
0.7 |
Sampling temperature |
vishnubot.customInstructions |
|
Instructions added to every chat |
vishnubot.chat.autoContext |
file |
Send the open file (file), only selections (selection), or nothing (off) |
vishnubot.chat.showStats |
true |
Token use and speed under answers |
vishnubot.history.summarize |
true |
Summarise messages that no longer fit |
vishnubot.history.maxConversations |
200 |
Saved chats kept per workspace |
vishnubot.inlineCompletions.enabled |
false |
Ghost-text completions |
vishnubot.inlineCompletions.model |
|
Completion model (empty: chat model) |
vishnubot.inlineCompletions.mode |
auto |
auto, fim (fill-in-the-middle) or chat |
vishnubot.inlineCompletions.debounceMs |
350 |
Typing pause before asking |
vishnubot.inlineCompletions.maxTokens |
128 |
Max tokens per completion |
vishnubot.inlineCompletions.disabledLanguages |
plaintext, markdown, scminput |
Languages without completions |
vishnubot.terminal.enabled |
true |
Let the model run commands (with approval) |
vishnubot.terminal.autoApprove |
[] |
Command prefixes that run without asking |
vishnubot.terminal.timeoutSeconds |
120 |
Stop commands after this long |
vishnubot.index.enabled |
true |
Workspace index for search by meaning |
vishnubot.index.embeddingModel |
|
Embedding model (empty: keyword index only) |
vishnubot.index.maxFiles |
5000 |
Most files to index |
vishnubot.webSearch.enabled |
true |
Let the model search the web |
vishnubot.webSearch.engine |
duckduckgo |
duckduckgo, serper or tavily |
vishnubot.documents.folder |
Documents\VishnuBot |
Where Word/PDF files are saved |
vishnubot.edits.reviewMode |
batch |
batch: review all changed files together at the end; each: approve each edit as it's made |
vishnubot.rules.enabled |
true |
Send .vishnubot/rules.md (or AGENTS.md) with every chat |
vishnubot.mcp.enabled |
true |
Let the model use MCP servers' tools |
vishnubot.mcp.servers |
{} |
MCP servers (see above) |
vishnubot.desktopSync.enabled |
true |
Copy chats and token use to the desktop app when it's running |
Keyboard shortcuts
| Keys |
|
Ctrl+Alt+I |
Ask about the selection |
Ctrl+. |
Lightbulb: Fix / Explain / Write tests / Add docs / Refactor |
Ctrl+Alt+Shift+I |
Turn inline completions on/off |
Alt+\ |
Ask for an inline completion now |
Ctrl+Alt+N |
New chat (in the panel) |
Privacy and safety
- Secret files (
.env, keys, certificates) and anything outside the open folder are never read or indexed automatically; attach them yourself if needed.
- File edits, commands and MCP tool calls need your approval (commands can be pre-approved by prefix; chained commands always ask). An answer's file changes can be undone.
- Workspace MCP servers (
.vscode/mcp.json) start only in trusted workspaces, after you allow each one.
- Desktop sync only ever talks to the VishnuBot desktop app on this PC (a
127.0.0.1 address); nothing else receives your chats.
- The workspace index is stored in VS Code's private storage for this workspace. Workspace Index… → Rebuild starts it from scratch.
- Web search, Word/PDF creation and workspace tools need a model that supports tool calling. Other models still chat normally.
Development
npm install
npm run build # bundle into dist/
npm run watch # rebuild on change (F5 runs the extension)
npm run typecheck
npm test # unit tests (Node) + integration tests (VS Code)
npm run test:unit # fast: pure modules and the API client against a mock server
npm run test:integration # in a VS Code test instance (uses your installed VS Code, or downloads one)
npm run test:e2e # end-to-end with the real model (uses the desktop app's config)
npm run package # typecheck, bundle, and create vishnubot-<version>.vsix
Install the .vsix with Extensions → … → Install from VSIX… or code --install-extension vishnubot-1.4.0.vsix. Publishing to the Marketplace and Open VSX is described in PUBLISHING.md.
Layout
| File |
|
src/extension.ts |
Activation: registers views, providers, commands, status bar items |
src/chatView.ts |
Chat panel: saved chats, automatic editor context, approvals, rendering |
src/webview/ |
Panel UI (browser side) |
src/agent.ts |
Chat loop with tools, context fitting, summaries, stats |
src/contextBudget.ts |
Token budget: fitting history, truncation, tool-output compaction |
src/conversations.ts |
Saved chats storage (index + one key per chat, ordered writes) |
src/llm.ts |
OpenAI-compatible client: streaming chat, usage, completions, embeddings |
src/toolHost.ts |
Tools given to the model (workspace, terminal, index) |
src/workspaceTools.ts |
Files, search, problems, symbols, reviewed edits |
src/terminalTool.ts, src/commandPolicy.ts |
Approved shell commands |
src/indexing/ |
Workspace index: chunking, BM25, embeddings, rank fusion, persistence |
src/inlineCompletion.ts, src/completionText.ts |
Ghost-text completions |
src/codeActions.ts |
Lightbulb actions |
src/participant.ts |
@vishnubot in VS Code's Chat view |
src/config.ts |
Settings, secrets, saved connections |
src/plan.ts |
Plan mode: prompts, parsing the plan, progress |
src/changeSet.ts, src/checkpoints.ts |
Staged edits for review; checkpoints for undo |
src/git.ts |
Commit messages, change reviews, PR descriptions (git CLI) |
src/mcp/ |
MCP client (stdio and Streamable HTTP) and server manager |
src/rules.ts |
Project rules files |
src/usageLog.ts, src/usagePanel.ts |
Usage log and view |
src/desktopLink.ts |
Chat and usage sync with the desktop app |
| |