Developers

How the extension is organized

LocalPilot uses small TypeScript modules around VS Code APIs, Ollama calls, context building, webviews, and editor-safe apply flows.

Activation and commands

src/extension.ts wires command registration, inline completions, code actions, onboarding, status bar, and chat.

Ollama integration

src/ollama contains health checks, local model listing, chat, completion, and model pull calls against the configured host.

Context and safety

src/context builds bounded prompt context, blocks sensitive paths, skips large files, and redacts secret-like strings.

Editor UI

src/webview powers chat, src/status powers the status menu, and src/apply handles diff preview plus explicit apply confirmation.

Performance controls

src/performance implements mode resolution, request limiting, completion caching, and token budgets.

Prompts and tests

src/prompts holds task prompts, while test coverage checks providers, commands, context, onboarding, Ollama, webviews, and apply behavior.

Development commands

Build, lint, test, and package

The extension expects Node.js 20 or newer and VS Code 1.90 or newer. Run checks before opening a pull request.

npm run compile
npm run lint
npm test
npm run package

Contribution principles

Keep LocalPilot local, focused, and safe

  • Keep the assistant local-first.
  • Do not add cloud AI APIs.
  • Do not add telemetry.
  • Prefer VS Code APIs and simple TypeScript modules.
  • Respect filters for secrets, generated files, dependency folders, and large files.
  • Every Ollama-backed feature should fail gracefully when Ollama is unavailable.