AI code assistant for VS Code that uses Ollama (or any OpenAI-compatible endpoint) to edit your code via native VS Code API — line-by-line, like Copilot.
Features
Chat panel in VS Code sidebar — ask questions or request code changes in natural language
Line-by-line file editing — insert, update, or delete code at specific line numbers using VS Code's native TextEditor.edit() API
Read-only terminal — the LLM can run ls, cat, git, grep, etc., but all write/delete/redirect commands are blocked and redirected to the editor tool
Tool-calling loop — the LLM uses structured tool calls (vscode_file_editor, terminal_readonly) instead of raw JSON or freeform text
Configurable endpoint & model — works with local Ollama, OpenAI, or any OpenAI-compatible API
Requirements
Ollama running locally (or any OpenAI-compatible API endpoint)
A model that supports tool/function calling (e.g., llama3.2, qwen2.5, mistral, gpt-4o)
Usage
Open the Command Palette (Ctrl+Shift+P) and run "Open Ollama Chat"
Type a message like:
"Add a greeting function at line 10 of src/app.ts"
"Explain this code"
"Refactor this function to use async/await"
The LLM will call tools to read files, edit code, or run terminal commands as needed
Configuration
Setting
Default
Description
ollama-editor.endpoint
http://localhost:11434
API endpoint URL
ollama-editor.model
llama3.2
Model name (must support tool calling)
ollama-editor.apiKey
""
API key for OpenAI-compatible endpoints
How it works
User message → Ollama API (with tool definitions) → tool call
├─ vscode_file_editor → VS Code API applies line edits
└─ terminal_readonly → guarded shell execution (read-only)
Result → Ollama API → final response → chat UI
Development
git clone <repo>
cd ollama-editor
npm install
npm run watch
# Press F5 in VS Code to launch Extension Dev Host