docs(opencode): split the config example by OpenCode version

OpenCode V1 rejects a top-level permissions field, so the mixed config the installer writes does not start on V1.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
MaheshtheDev 2026-10-28 22:20:43 +00:00
parent 888122dc64
commit d0d30d9c52

View file

@ -60,17 +60,33 @@ Or set an API key manually from the [API Keys](https://console.supermemory.ai/ke
</Tab>
</Tabs>
The installer registers the plugin for both OpenCode V1 (`plugin`) and OpenCode 2 (`plugins`). Ensure your `~/.config/opencode/opencode.jsonc` contains:
OpenCode V1 and OpenCode 2 read different keys from `~/.config/opencode/opencode.jsonc`. Use the config for the version you run:
```jsonc
{
"plugin": ["opencode-supermemory@latest"],
"plugins": ["opencode-supermemory"],
"permissions": [
{ "action": "supermemory_recall", "resource": "*", "effect": "allow" }
]
}
```
<Tabs>
<Tab title="OpenCode V1">
```jsonc
{
"plugin": ["opencode-supermemory@latest"]
}
```
</Tab>
<Tab title="OpenCode 2">
```jsonc
{
"plugins": ["opencode-supermemory"],
"permissions": [
{ "action": "supermemory_recall", "resource": "*", "effect": "allow" }
]
}
```
The `permissions` rule lets the read-only `supermemory_recall` tool run without prompting.
</Tab>
</Tabs>
<Warning>
The installer writes all three keys (`plugin`, `plugins`, and `permissions`) so that one file covers both versions. OpenCode V1 refuses to start when the file has a top-level `permissions` field ("V2 permissions are not supported by OpenCode V1"), so V1 users must remove `permissions` after installing. V1 ignores `plugins` with a warning, so you can remove it too.
</Warning>
## How it works