Skip to content
Vector
Esc
↑↓navigate↵open⌘Jpreview

Build reusable OpenCode configurations

Define reusable OpenCode 2 configurations, activate them through ordinary ESM packages, and evaluate their behavior with Vector.

Vector gives Configuration Authors one typed path from reusable Extension Definitions to an OpenCode Plugin Entrypoint.

This minimal configuration adds a project-aware command:

import { defineCommand, defineVector } from '@evilkiwi/vector';

const projectSummary = defineCommand({
  name: 'project-summary',
  build: (context) => ({
    template: `Summarize the project at ${context.project.canonical}`,
  }),
});

export default defineVector({
  id: 'project-tools',
  build: () => ({ commands: [projectSummary] }),
});

Vector integrates with the OpenCode 2 types pinned by the package. Install Vector, follow the Quickstart, or read Concepts for the complete model.