Skip to content

This guide covers everything you need to build, test, and contribute to Opilot.

Prerequisites

ToolVersion
Node.js20+
pnpmpinned in package.json
VS Code1.109.0+
Ollamalatest
GitHub Copilot Chatlatest

Install task (the Taskfile runner):

bash
brew install go-task
# or
npm install -g @go-task/cli

Setting Up

bash
# Clone
git clone https://github.com/selfagency/opilot
cd opilot

# Install dependencies
pnpm install

# Build
task compile

Running the Extension

Press F5 in VS Code to open an Extension Development Host with the extension loaded. Changes require re-running task compile (or use task watch for incremental rebuilds).

Available Tasks

Run tasks with task <name>:

TaskDescription
compileType-check + bundle the extension
watchWatch mode — rebuild on file change
lintRun oxlint
lint-fixAuto-fix lint issues
check-formattingCheck code formatting (oxfmt)
check-typesTypeScript type check only
unit-testsRun Vitest unit tests
unit-test-coverageUnit tests + coverage report
extension-testsVS Code integration tests
integration-testsEnd-to-end tests (requires Ollama)
precommitFull pre-commit check (type + lint + format)
releaseBuild and publish a release

Directory Structure

src/
  extension.ts         # Activation, chat participant, log streaming
  provider.ts          # VS Code LM API provider implementation
  sidebar.ts           # Tree views, model lifecycle commands
  modelfiles.ts        # Modelfile parsing and tree provider
  completions.ts       # Inline code completion provider
  formatting.ts        # XML tag stripping utilities
  diagnostics.ts       # Centralized logging abstraction
  client.ts            # Ollama HTTP client wrapper
  test/
    vscode.mock.ts     # VS Code API mock (used by Vitest)
docs/
  ARCHITECTURE.md      # Architecture overview
  plans/               # Planning notes and design docs
syntaxes/
  modelfile.tmLanguage.json  # Modelfile syntax grammar
.vitepress/            # Docs site config

Next Steps

Released under the MIT License