Learn how to create a custom plugin for OpenSIN CLI.
mkdir my-plugin && cd my-plugin
npm init -y{
"name": "opencode-plugin-my-plugin",
"version": "0.1.0",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc",
"test": "vitest run"
}
}// src/plugin.ts
export class MyPlugin {
getManifest() {
return {
id: 'my-plugin',
name: 'My Plugin',
version: '0.1.0',
description: 'My custom plugin',
author: 'You',
license: 'MIT',
};
}
}npm install -g .{
"plugin": ["opencode-plugin-my-plugin"]
}