Add packages/opencode-config and use it

This commit is contained in:
Shantur Rathore
2025-12-17 22:58:41 +00:00
parent 06be455358
commit 722b523f92
6 changed files with 90 additions and 3 deletions

View File

@@ -0,0 +1,3 @@
{
"$schema": "https://opencode.ai/config.json"
}

View File

@@ -0,0 +1,18 @@
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}!`
},
}),
},
}
}