---
title: Build and run your first Vector Configuration
description: Define a project-aware command, load its OpenCode Plugin Entrypoint, invoke it, and recover from common setup errors.
sidebar:
  label: Quickstart
---

This tutorial starts from a Node.js 24 ESM project with Vector installed. It creates one command and loads it directly from source.

1. **Define the extension**

    Create an Extension Definition with the fixed command name `project-summary`.

    ```ts title="src/extensions.ts"
    import { defineCommand } from '@evilkiwi/vector';

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

        The module now exports one reusable Extension Definition. Its command template is assembled from the active Context during activation.

2. **Define the configuration**

    Select the extension in the Extension Plan and default-export the returned OpenCode Plugin Entrypoint.

    ```ts title="src/opencode.ts"
    import { defineVector } from '@evilkiwi/vector';

    import { projectSummary } from './extensions.js';

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

        The default export is the OpenCode `Plugin.Plugin` value for this Vector Configuration.

3. **Load the entrypoint**

    Add the module to OpenCode's `plugins` setting with an absolute file URL.

    ```json title="opencode.json"
    {
      "plugins": ["file:///absolute/path/to/your-project/src/opencode.ts"]
    }
    ```

        Replace the example path with the absolute path to your project before starting OpenCode.

4. **Invoke the command**

    Start OpenCode with that configuration, then invoke the registered command.

    ```text title="OpenCode"
    /project-summary
    ```

        Success is observable when OpenCode accepts `project-summary` and starts a response from the prompt that names the active project's canonical path.

## Recover from likely errors

| Symptom                              | Check                                                                                        | Recovery                                                                                       |
| ------------------------------------ | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| The plugin module does not load      | The URL is absolute, uses `file://`, and points to `src/opencode.ts`.                        | Correct the URL, then reload OpenCode.                                                         |
| `project-summary` is not available   | `src/opencode.ts` default-exports the value returned by `defineVector()`.                    | Restore the default export, then reload OpenCode.                                              |
| The source cannot resolve its import | The relative import uses the ESM `.js` specifier and the project can execute TS entrypoints. | Correct the import or load the built ESM entrypoint described in [Package](/activate/package). |

Vector resolves Context, builds the Extension Plan, materializes and preflights the Snapshot, then registers the command with OpenCode.

Next, [reuse the extension](/build/reuse) or review the [core concepts](/start/concepts).
