From a3cd63894bee5cf8d7049a9ce4515031f5ddc74b Mon Sep 17 00:00:00 2001 From: dannyward630 Date: Thu, 18 Jun 2026 20:17:53 +0200 Subject: [PATCH] docs: document plugin spec forms --- packages/web/src/content/docs/config.mdx | 4 ++-- packages/web/src/content/docs/plugins.mdx | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/web/src/content/docs/config.mdx b/packages/web/src/content/docs/config.mdx index c1a69f5a866d..6e69efcc49ab 100644 --- a/packages/web/src/content/docs/config.mdx +++ b/packages/web/src/content/docs/config.mdx @@ -777,12 +777,12 @@ You can configure MCP servers you want to use through the `mcp` option. [Plugins](/docs/plugins) extend OpenCode with custom tools, hooks, and integrations. -Place plugin files in `.opencode/plugins/` or `~/.config/opencode/plugins/`. You can also load plugins from npm through the `plugin` option. +Place plugin files in `.opencode/plugins/` or `~/.config/opencode/plugins/`. You can also load plugins through the `plugin` option with npm package specs, git-backed package specs, or `file://` URLs. ```json title="opencode.json" { "$schema": "https://opencode.ai/config.json", - "plugin": ["opencode-helicone-session", "@my-org/custom-plugin"] + "plugin": ["opencode-helicone-session", "@my-org/custom-plugin", "file:///absolute/path/to/my-plugin.ts"] } ``` diff --git a/packages/web/src/content/docs/plugins.mdx b/packages/web/src/content/docs/plugins.mdx index a8be798217a8..ee3b449cde6d 100644 --- a/packages/web/src/content/docs/plugins.mdx +++ b/packages/web/src/content/docs/plugins.mdx @@ -24,16 +24,30 @@ Place JavaScript or TypeScript files in the plugin directory. Files in these directories are automatically loaded at startup. +You can also reference a specific local plugin file from your config with a `file://` URL. + +```json title="opencode.json" +{ + "$schema": "https://opencode.ai/config.json", + "plugin": ["file:///absolute/path/to/my-plugin.ts"] +} +``` + --- ### From npm -Specify npm packages in your config file. +Specify npm packages in your config file. Bun package specifiers are supported, including scoped packages and git-backed packages. ```json title="opencode.json" { "$schema": "https://opencode.ai/config.json", - "plugin": ["opencode-helicone-session", "opencode-wakatime", "@my-org/custom-plugin"] + "plugin": [ + "opencode-helicone-session", + "opencode-wakatime", + "@my-org/custom-plugin", + "opencode-scheduler@git+https://github.com/different-ai/opencode-scheduler.git" + ] } ```