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] }),
});
Build your first configuration
Install Vector, define an extension, load it in OpenCode, and verify the command.
Compose reusable extensions
Define extensions once and select them in more than one Vector Configuration.
Activate a package
Publish an ESM Configuration Package and connect its entrypoint to OpenCode.
Evaluate behavior
Run a Vector Configuration in a disposable Fixture and inspect its evidence.
Vector integrates with the OpenCode 2 types pinned by the package. Install Vector, follow the Quickstart, or read Concepts for the complete model.