Files
CodeNomad/packages/opencode-config/plugin/hello.js
2025-12-17 22:58:41 +00:00

19 lines
442 B
JavaScript

import { tool } from "@opencode-ai/plugin/tool"
export async function HelloPlugin() {
return {
tool: {
hello: tool({
description: "Return a friendly greeting",
args: {
name: tool.schema.string().optional().describe("Name to greet"),
},
async execute(args) {
const target = args.name?.trim() || "CodeNomad"
return `Hello, ${target}!`
},
}),
},
}
}