From bb4b24a05fed931f4fb3d8654e193091767681bd Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Wed, 13 Aug 2025 20:03:44 -0500 Subject: [PATCH] docs: fix bad example (#1913) --- packages/web/src/content/docs/docs/plugins.mdx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/web/src/content/docs/docs/plugins.mdx b/packages/web/src/content/docs/docs/plugins.mdx index 08c697a6..22c78b0b 100644 --- a/packages/web/src/content/docs/docs/plugins.mdx +++ b/packages/web/src/content/docs/docs/plugins.mdx @@ -93,13 +93,9 @@ Prevent opencode from reading `.env` files: ```javascript title=".opencode/plugin/env-protection.js" export const EnvProtection = async ({ client, $ }) => { return { - tool: { - execute: { - before: async (input, output) => { - if (input.tool === "read" && output.args.filePath.includes(".env")) { - throw new Error("Do not read .env files") - } - } + "tool.execute.before": async (input, output) => { + if (input.tool === "read" && output.args.filePath.includes(".env")) { + throw new Error("Do not read .env files") } } }