Download packages/plugin/src/example.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 397 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/plugin/src/example.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/plugin/src/example.ts
-
curl -L -o example.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/plugin/src/example.ts
397 Bytes
| import { Plugin } from "./index.js" | |
| import { tool } from "./tool.js" | |
| export const ExamplePlugin: Plugin = async (_ctx) => { | |
| return { | |
| tool: { | |
| mytool: tool({ | |
| description: "This is a custom tool", | |
| args: { | |
| foo: tool.schema.string().describe("foo"), | |
| }, | |
| async execute(args) { | |
| return `Hello ${args.foo}!` | |
| }, | |
| }), | |
| }, | |
| } | |
| } | |