This commit is contained in:
2026-01-13 01:16:05 +08:00
commit bf88cfab5c
9 changed files with 670 additions and 0 deletions

22
plugin/src/index.ts Normal file
View File

@@ -0,0 +1,22 @@
import { tool } from "@opencode-ai/plugin/tool";
import type { Plugin, PluginInput } from "@opencode-ai/plugin";
const MyPlugin: Plugin = async (ctx: PluginInput) => {
console.log("Plugin loaded!", ctx.project.name);
return {
tool: {
greet: tool({
description: "Greet someone",
args: {
name: tool.schema.string().describe("The name to greet"),
},
async execute(args) {
return `Hello, ${args.name}!`;
},
}),
},
};
};
export default MyPlugin;