Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

docs(opencode-plugin): document account/user tenant config from #1820 (#1861)

Evoc96884816905
diff --git a/examples/opencode-memory-plugin/README.md b/examples/opencode-memory-plugin/README.md
index 4374d0b5e..fec53eb98 100644
--- a/examples/opencode-memory-plugin/README.md
+++ b/examples/opencode-memory-plugin/README.md
@@ -71,10 +71,12 @@ OpenCode auto-discovers first-level `*.ts` and `*.js` files under `~/.config/ope
This plugin also works if you intentionally place it in a workspace-local plugin directory, because it stores config and runtime files next to the plugin file itself.
-Recommended: provide the API key via environment variable instead of writing it into the config file:
+Recommended: provide the API key and tenant identity via environment variables instead of writing them into the config file:
```bash
export OPENVIKING_API_KEY="your-api-key-here"
+export OPENVIKING_ACCOUNT="default"
+export OPENVIKING_USER="opencode"
```
## Configuration
@@ -85,6 +87,8 @@ Example config:
{
"endpoint": "http://localhost:1933",
"apiKey": "",
+ "account": "default",
+ "user": "opencode",
"enabled": true,
"timeoutMs": 30000,
"autoCommit": {
@@ -94,7 +98,9 @@ Example config:
}
```
-The environment variable `OPENVIKING_API_KEY` takes precedence over the config file.
+`account` and `user` are sent as `X-OpenViking-Account` and `X-OpenViking-User` tenant headers on every plugin API request; leave them empty to omit the headers.
+
+The environment variables `OPENVIKING_API_KEY`, `OPENVIKING_ACCOUNT`, and `OPENVIKING_USER` take precedence over the config file.
## Runtime Files
@@ -216,6 +222,8 @@ Add an `autoRecall` block to your `openviking-config.json` to customize recall b
{
"endpoint": "http://localhost:1933",
"apiKey": "",
+ "account": "default",
+ "user": "opencode",
"enabled": true,
"timeoutMs": 30000,
"autoCommit": {
diff --git a/examples/opencode-memory-plugin/README_CN.md b/examples/opencode-memory-plugin/README_CN.md
index 7d7167164..cbf049f21 100644
--- a/examples/opencode-memory-plugin/README_CN.md
+++ b/examples/opencode-memory-plugin/README_CN.md
@@ -71,10 +71,12 @@ OpenCode 会自动发现 `~/.config/opencode/plugins` 下一级目录中的 `*.t
如果您有意将插件放置在工作区本地插件目录中,此插件也可以使用,因为它会将配置和运行时文件存储在插件文件旁边。
-推荐:通过环境变量提供 API 密钥,而不是将其写入配置文件:
+推荐:通过环境变量提供 API 密钥和租户身份,而不是将其写入配置文件:
```bash
export OPENVIKING_API_KEY="your-api-key-here"
+export OPENVIKING_ACCOUNT="default"
+export OPENVIKING_USER="opencode"
```
## 配置
@@ -85,6 +87,8 @@ export OPENVIKING_API_KEY="your-api-key-here"
{
"endpoint": "http://localhost:1933",
"apiKey": "",
+ "account": "default",
+ "user": "opencode",
"enabled": true,
"timeoutMs": 30000,
"autoCommit": {
@@ -94,7 +98,9 @@ export OPENVIKING_API_KEY="your-api-key-here"
}
```
-环境变量 `OPENVIKING_API_KEY` 优先于配置文件。
+`account` 和 `user` 会作为 `X-OpenViking-Account` 与 `X-OpenViking-User` 租户头随每次插件 API 请求发送;留空则不会附加这些头。
+
+环境变量 `OPENVIKING_API_KEY`、`OPENVIKING_ACCOUNT` 和 `OPENVIKING_USER` 优先于配置文件。
## 运行时文件