Files
skills-template/plugin/example.ts
2026-01-11 01:10:38 +08:00

21 lines
528 B
TypeScript

import { tool, type Plugin } from "@opencode-ai/plugin"
// 列出工具列表便能获取到更多示例
export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree }) => {
console.log("Plugin initialized!")
return {
// Hook implementations go here
tool: {
mytool: tool({
description: "获取foo的问候语",
args: {
foo: tool.schema.string(),
},
async execute(args, ctx) {
return `Hello ${args.foo}!`
},
}),
}
}
}