Skip to content

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

docs: correct SDK, CLI and integration setup examples (#5192)

Zayn Jarvis1ad0c4342a7b
diff --git a/docs/en/agent-integrations/09-log-ingestion.md b/docs/en/agent-integrations/09-log-ingestion.md
index 5a31dfa4d..1e4694fa2 100644
--- a/docs/en/agent-integrations/09-log-ingestion.md
+++ b/docs/en/agent-integrations/09-log-ingestion.md
@@ -31,6 +31,15 @@ The feature is doubly disabled and must be turned on explicitly:
## Enable in ov.conf
+Set these variables in the same shell that will run the ingest commands. This example targets a local dev server; for an authenticated server, replace the URL and use a tenant-bound user/admin API key:
+
+```bash
+export OPENVIKING_URL="http://localhost:1933"
+export OPENVIKING_API_KEY="" # Local dev only; set a user/admin key for authenticated deployments.
+```
+
+The config loader expands these variables. Unset variables remain literal strings, so do not skip this step when using the placeholders below.
+
Add an `ingest` section to `ov.conf`, listing the harnesses to import and their mode:
```json
diff --git a/docs/en/agent-integrations/11-pi.md b/docs/en/agent-integrations/11-pi.md
index 27816290b..01e1c2dac 100644
--- a/docs/en/agent-integrations/11-pi.md
+++ b/docs/en/agent-integrations/11-pi.md
@@ -43,8 +43,8 @@ Manual copy from a repo checkout also works:
git clone https://github.com/volcengine/OpenViking.git
cd OpenViking
node examples/memory-plugin-shared/sync.mjs
-mkdir -p ~/.pi/agent/extensions
-cp -r examples/pi-coding-agent-extension ~/.pi/agent/extensions/openviking
+mkdir -p ~/.pi/agent/extensions/openviking
+cp -R examples/pi-coding-agent-extension/. ~/.pi/agent/extensions/openviking/
```
The extension imports its shared modules from a `shared/` directory that is not in git; `sync.mjs` generates it, so run it before copying. After a `git pull`, run `sync.mjs` again before copying the update.
diff --git a/docs/en/agent-integrations/15-agent-plugins.md b/docs/en/agent-integrations/15-agent-plugins.md
index 3b57ea51a..6eb04ca08 100644
--- a/docs/en/agent-integrations/15-agent-plugins.md
+++ b/docs/en/agent-integrations/15-agent-plugins.md
@@ -15,6 +15,7 @@ agent-plugins/
│ └── shared/ # generated from examples/memory-plugin-shared/lib
├── skills/openviking-memory/SKILL.md # teaches the model the recall + persist loop
├── skills/ov-experience-memory/SKILL.md # retrieve and apply prior task Experience
+├── skills/ov-memory-troubleshoot/SKILL.md # trace memory issues to session evidence
└── plugin.test.mjs # node --test conformance checks
```
@@ -25,7 +26,7 @@ Zero npm dependencies — the proxy and the tests run on the Node.js standard li
1. Have an OpenViking server reachable. If you don't, follow the [Quickstart](../getting-started/02-quickstart.md); the default local endpoint is `http://127.0.0.1:1933`.
2. Point your Agent-Plugins-conforming client at the `agent-plugins/` directory. Each client has its own install command or plugin directory — consult its docs. On load the client will:
- register the `openviking` MCP server from `mcp.json`, running `node <plugin>/servers/mcp-proxy.mjs` over stdio;
- - discover the `openviking-memory` and `ov-experience-memory` skills from `skills/`.
+ - discover the `openviking-memory`, `ov-experience-memory`, and `ov-memory-troubleshoot` skills from `skills/`.
3. Configure credentials (below) and start a session. The model gains `find` / `search` / `read` / `list` / `grep` / `glob` / `remember` / `add_resource` / `forget` / `health`, plus `tree` / `write` / `edit` on recent servers.
## Why a stdio proxy instead of a `streamable-http` entry
diff --git a/docs/en/api/01-overview.md b/docs/en/api/01-overview.md
index 1ed598c17..0419cbf45 100644
--- a/docs/en/api/01-overview.md
+++ b/docs/en/api/01-overview.md
@@ -17,6 +17,12 @@ Client-Server mode connects to an OpenViking server via HTTP API, supporting mul
#### Python SDK Client
+Install the standalone SDK in the Python environment that runs your code:
+
+```bash
+python -m pip install --upgrade openviking-sdk
+```
+
```python
from openviking_sdk import SyncHTTPClient
@@ -115,32 +121,32 @@ Configuration field description:
| `api_key` | API Key | `null` (no auth) |
| `account` | Default account header for tenant-scoped requests | `null` |
| `user` | Default user header for tenant-scoped requests | `null` |
-| `timeout` | HTTP request timeout in seconds | `600.0` |
+| `timeout` | HTTP request timeout in seconds | `60.0` |
| `output` | Default output format: `"table"` or `"json"` | `"table"` |
See the [Configuration Guide](../guides/01-configuration.md#ovcli-conf) for details.
#### Using Python SDK Client Without Configuration File
-`SyncHTTPClient` and `AsyncHTTPClient` support operating completely without relying on the `ovcli.conf` configuration file, by **explicitly passing all parameters** during initialization:
+`SyncHTTPClient` and `AsyncHTTPClient` work without an `ovcli.conf` file. Install the standalone SDK in the Python environment that runs your code:
+
+```bash
+python -m pip install --upgrade openviking-sdk
+```
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(
- url="http://localhost:1933", # Explicitly provided
- api_key="your-key", # Explicitly provided (api_key usually identifies user identity)
- timeout=30.0, # Don't use default 600.0
- extra_headers={} # Pass empty dict instead of None, useful for gateway auth in some scenarios
+ url="http://localhost:1933",
+ api_key="your-key",
+ timeout=30.0,
+ extra_headers={},
)
client.initialize()
```
-⚠️ **Note**: The client will attempt to load the configuration file if any of the following conditions are met:
-- `url` is `None`
-- `api_key` is `None`
-- `timeout` equals `600.0` (default value)
-- `extra_headers` is `None`
+The SDK still reads an existing `ovcli.conf` when you pass explicit parameters. Explicit values override the corresponding settings; other settings may come from environment variables or the file. Invalid configuration can therefore fail client construction. The default timeout is 60 seconds. See [client configuration](../configuration/02-client.md) for the file location.
#### HTTP Call Examples
@@ -160,12 +166,12 @@ curl http://localhost:1933/api/v1/fs/ls?uri=viking:// \
#### CLI Mode
-The OpenViking CLI (can be abbreviated as `ov` command) connects to an OpenViking server and exposes all operations as shell commands. The CLI also reads connection information from `ovcli.conf` (shared with the HTTP client).
+The OpenViking CLI command is `ov` (installed with `npm install -g @openviking/cli`). It connects to an OpenViking server and exposes all operations as shell commands. The CLI also reads connection information from `ovcli.conf` (shared with the HTTP client).
Basic usage:
```bash
-openviking [global options] <command> [arguments] [command options]
+ov [global options] <command> [arguments] [command options]
```
Global options (must be placed before the command name):
@@ -178,7 +184,7 @@ Global options (must be placed before the command name):
Example:
```bash
-openviking -o json ls viking://resources/
+ov -o json ls viking://resources/
```
## Lifecycle
@@ -186,7 +192,7 @@ openviking -o json ls viking://resources/
### Client-Server Mode
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933")
client.initialize()
@@ -199,7 +205,7 @@ client.close()
The CLI is called directly via the command line, requiring the `ovcli.conf` file to be configured first, with no additional client initialization needed:
```
-openviking -o json ls viking://resources/
+ov -o json ls viking://resources/
```
## Authentication
@@ -253,18 +259,24 @@ Python HTTP SDKs (`SyncHTTPClient` and `AsyncHTTPClient`) raise the correspondin
List data is rendered as tables; non-list data falls back to formatted JSON:
```bash
-openviking ls viking://resources/
+ov ls viking://resources/
# name size mode isDir uri
# .abstract.md 100 420 False viking://resources/.abstract.md
```
### JSON Mode (`--output json`)
-All commands output formatted JSON, matching the `result` structure of API responses:
+By default, `-o json` uses compact output with an `{ok, result}` wrapper:
+
+```bash
+ov -o json ls viking://resources/
+# {"ok":true,"result":[{"name":"...","size":100,...},...]}
+```
+
+Use `--compact=false` to return the unwrapped result as formatted JSON:
```bash
-openviking -o json ls viking://resources/
-# [{ "name": "...", "size": 100, ... }, ...]
+ov -o json --compact=false ls viking://resources/
```
The default output format can be set in `ovcli.conf`:
@@ -276,7 +288,7 @@ The default output format can be set in `ovcli.conf`:
}
```
-### Compact Mode (`--compact`, `-c`)
+### Compact Mode (`--compact`, `-c`, enabled by default)
- When `--output=json`: Compact JSON format + `{ok, result}` wrapper, suitable for scripts
- When `--output=table`: Simplified representation for table output (e.g., removing empty columns)
diff --git a/docs/en/api/04-skills.md b/docs/en/api/04-skills.md
index ef3ff5034..57f3c726d 100644
--- a/docs/en/api/04-skills.md
+++ b/docs/en/api/04-skills.md
@@ -314,7 +314,7 @@ curl -X POST http://localhost:1933/api/v1/skills \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
client.initialize()
diff --git a/docs/en/api/05-sessions.md b/docs/en/api/05-sessions.md
index 411309579..1500e7fdb 100644
--- a/docs/en/api/05-sessions.md
+++ b/docs/en/api/05-sessions.md
@@ -96,7 +96,7 @@ curl -X POST http://localhost:1933/api/v1/sessions \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
# Use HTTP client
client = ov.AsyncHTTPClient(url="http://localhost:1933", api_key="your-key")
@@ -842,7 +842,7 @@ curl -X GET "http://localhost:1933/api/v1/sessions/a1b2c3d4/archives/archive_002
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.AsyncHTTPClient(url="http://localhost:1933", api_key="your-key")
await client.initialize()
@@ -960,7 +960,7 @@ curl -X DELETE http://localhost:1933/api/v1/sessions/a1b2c3d4 \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.AsyncHTTPClient(url="http://localhost:1933", api_key="your-key")
await client.initialize()
@@ -1135,7 +1135,7 @@ curl -X POST http://localhost:1933/api/v1/sessions/a1b2c3d4/messages \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
from openviking_sdk import ContextPart, ImagePart, TextPart
client = ov.AsyncHTTPClient(url="http://localhost:1933", api_key="your-key")
@@ -1452,7 +1452,7 @@ curl -X GET http://localhost:1933/api/v1/tasks/{task_id} \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.AsyncHTTPClient(url="http://localhost:1933", api_key="your-key")
await client.initialize()
diff --git a/docs/en/api/06-retrieval.md b/docs/en/api/06-retrieval.md
index 7fc6f07bb..7be8597e4 100644
--- a/docs/en/api/06-retrieval.md
+++ b/docs/en/api/06-retrieval.md
@@ -181,8 +181,7 @@ Tags must use strict `k=v` strings. When multiple tags are provided, `find()` re
**Python SDK**
```python
-import openviking as ov
-from openviking.retrieve import ContextType
+import openviking_sdk as ov
from openviking_sdk import TextPart
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
@@ -204,7 +203,7 @@ recent_emails = client.find(
# Search only memories and resources
typed_results = client.find(
query="authentication",
- options={"context_type": [ContextType.MEMORY, ContextType.RESOURCE]},
+ options={"context_type": ["memory", "resource"]},
)
# Search by local image, bytes, data URI, HTTP URL, or viking:// URI
@@ -459,8 +458,7 @@ curl -X POST http://localhost:1933/api/v1/search/search \
**Python SDK**
```python
-import openviking as ov
-from openviking.retrieve import ContextType
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
client.initialize()
@@ -482,7 +480,7 @@ results = client.search(
query="best practices",
session_id=session.session_id,
options={
- "context_type": ContextType.SKILL,
+ "context_type": "skill",
"since": "2h",
},
)
@@ -838,7 +836,7 @@ curl -X POST http://localhost:1933/api/v1/search/grep \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
client.initialize()
@@ -980,7 +978,7 @@ curl -X POST http://localhost:1933/api/v1/search/glob \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
client.initialize()
@@ -1088,7 +1086,7 @@ Retrieval results usually only contain L0 summaries, you can progressively load
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
client.initialize()
@@ -1132,7 +1130,7 @@ curl -X GET "http://localhost:1933/api/v1/content/read?uri=viking://resources/do
### Use Specific Queries
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
client.initialize()
@@ -1147,7 +1145,7 @@ results = client.find(query="auth")
### Scope Your Searches
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
client.initialize()
@@ -1162,7 +1160,7 @@ results = client.find(
### Use Session Context for Conversations
```python
-import openviking as ov
+import openviking_sdk as ov
from openviking_sdk import TextPart
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
diff --git a/docs/en/api/07-system.md b/docs/en/api/07-system.md
index c693af1cb..8338c6a7d 100644
--- a/docs/en/api/07-system.md
+++ b/docs/en/api/07-system.md
@@ -57,7 +57,7 @@ curl -G http://localhost:1933/health \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933")
client.initialize()
diff --git a/docs/en/api/08-admin.md b/docs/en/api/08-admin.md
index 65fa106bb..905a30618 100644
--- a/docs/en/api/08-admin.md
+++ b/docs/en/api/08-admin.md
@@ -549,7 +549,7 @@ curl -X POST http://localhost:1933/api/v1/admin/accounts \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-key>")
client.initialize()
@@ -684,7 +684,7 @@ curl -X GET "http://localhost:1933/api/v1/admin/accounts?limit=50&page=2" \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-key>")
client.initialize()
@@ -790,7 +790,7 @@ curl -X DELETE http://localhost:1933/api/v1/admin/accounts/acme \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-key>")
client.initialize()
@@ -900,7 +900,7 @@ curl -X POST http://localhost:1933/api/v1/admin/accounts/acme/users \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-or-admin-key>")
client.initialize()
@@ -1046,7 +1046,7 @@ curl -X GET "http://localhost:1933/api/v1/admin/accounts/acme/users?limit=50&pag
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-or-admin-key>")
client.initialize()
@@ -1150,7 +1150,7 @@ curl -X DELETE http://localhost:1933/api/v1/admin/accounts/acme/users/bob \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-or-admin-key>")
client.initialize()
@@ -1250,7 +1250,7 @@ curl -X PUT http://localhost:1933/api/v1/admin/accounts/acme/users/bob/role \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-key>")
client.initialize()
@@ -1348,7 +1348,7 @@ curl -X POST http://localhost:1933/api/v1/admin/accounts/acme/users/bob/key \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-or-admin-key>")
client.initialize()
diff --git a/docs/en/api/14-ovpack.md b/docs/en/api/14-ovpack.md
index 35c3bbda9..04fa1290c 100644
--- a/docs/en/api/14-ovpack.md
+++ b/docs/en/api/14-ovpack.md
@@ -68,7 +68,7 @@ curl -X POST http://localhost:1933/api/v1/pack/export \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-admin-key")
client.initialize()
@@ -202,7 +202,7 @@ curl -X POST http://localhost:1933/api/v1/pack/import \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-admin-key")
client.initialize()
diff --git a/docs/en/configuration/02-client.md b/docs/en/configuration/02-client.md
index 5bcfa8883..bc82e074e 100644
--- a/docs/en/configuration/02-client.md
+++ b/docs/en/configuration/02-client.md
@@ -73,8 +73,8 @@ Omit fields you do not need. A local server in `dev` mode usually needs only `ur
| `url` | HTTP(S) URL | `http://127.0.0.1:1933` | OpenViking server endpoint |
| `api_key` | string / `null` | `null` | User/admin key for normal data operations |
| `root_api_key` | string / `null` | `null` | Root key for `ov --sudo` administrative operations |
-| `account` | string / `null` | `null` | Account identity for trusted or root-key-only configurations |
-| `user` | string / `null` | `null` | User identity for trusted or root-key-only configurations |
+| `account` | string / `null` | `null` | Account identity for trusted deployments |
+| `user` | string / `null` | `null` | User identity for trusted deployments |
| `actor_peer_id` | string / `null` | `null` | Default Actor Peer identifier |
| `agent_id` | string / `null` | `null` | Compatibility field; use `actor_peer_id` for new configs and do not set both |
| `extra_headers` | object / `null` | `null` | Additional headers sent with every request; `extra_header` is a compatibility alias |
@@ -85,7 +85,7 @@ Omit fields you do not need. A local server in `dev` mode usually needs only `ur
| Configuration | Normal Commands | `ov --sudo` |
|---|---|---|
| `api_key` only | User/admin key | unavailable |
-| `root_api_key` plus `account` and `user` | Root key with explicit identity | Root key |
+| `root_api_key` plus `account` and `user` | Trusted mode: root key with explicit identity; API key mode: tenant data access denied | Root key |
| Both keys | `api_key` | `root_api_key` |
| No keys | Local server with authentication disabled only | unavailable |
@@ -110,7 +110,7 @@ Omit fields you do not need. A local server in `dev` mode usually needs only `ur
| `show_progress` | boolean | `false` | Show upload progress by default |
| `verbose` | boolean | `false` | Show upload diagnostics by default |
| `profile` | boolean | `false` | Request performance profiles; also requires `server.profile_enabled` |
-| `output` | `"table"` / `"json"` | `"table"` | Compatibility field; use `-o table` or `-o json` to select current command output |
+| `output` | `"table"` / `"json"` | `"table"` | Default output format; `-o table` or `-o json` overrides it for the current command |
Command-line options such as `--profile`, `--progress`, `--no-progress`, and `--verbose` override the configuration for the current command.
diff --git a/docs/en/getting-started/05-cli-setup.md b/docs/en/getting-started/05-cli-setup.md
index b4b68ab71..7f200d694 100644
--- a/docs/en/getting-started/05-cli-setup.md
+++ b/docs/en/getting-started/05-cli-setup.md
@@ -43,7 +43,7 @@ Choose this when you connect to a custom OpenViking server hosted somewhere othe
- Server URL is provided by the user or server administrator.
- API key may be required.
-- Root-key-only configs require `--account` and `--user`.
+- Root-key-only data access requires a `trusted` server and explicit `--account` and `--user`; `api_key` servers require a user/admin key for data access.
### Local Custom
@@ -53,7 +53,7 @@ Choose this only when the user wants to connect to a custom OpenViking server on
- API key is usually not needed for a local unauthenticated server.
- Agents should not probe local ports, curl local health endpoints, or start server commands unless the user chose local custom setup.
-> **Note:** Recent CLI versions (v0.3.23+) require a saved display language before most commands will run. In an interactive terminal the CLI prompts you on first use; in a non-interactive shell (agent or CI) any non-exempt command exits `2` until you run `ov language en` or `ov language zh-CN`. Only `ov language`/`ov lang`, `ov config add|edit|delete|list`, and `ov config switch <name>` are exempt, so run `ov language <code>` before the `ov config validate`, `ov health`, and `ov status` checks above.
+> **Note:** Recent CLI versions (v0.3.23+) require a saved display language before most commands will run. In an interactive terminal the CLI prompts you on first use; in a non-interactive shell (agent or CI) any non-exempt command exits `2` until you run `ov language en` or `ov language zh-CN`. Only `ov language`/`ov lang`, `ov config add|edit|delete|list`, and `ov config switch <name>` are exempt, so run `ov language <code>` before the `ov config validate`, `ov health`, and `ov status` checks below.
## Before You Start
@@ -98,13 +98,7 @@ Or build the Rust CLI from source:
cargo install --git https://github.com/volcengine/OpenViking ov_cli
```
-The npm package is the simplest standalone CLI install. If you also want the Python SDK or server package, the Python package exposes `ov` too:
-
-```bash
-uv tool install openviking --upgrade
-# or
-pip install openviking --upgrade --force-reinstall
-```
+The npm package is the simplest standalone CLI install. The Python SDK is a separate package — install `openviking-sdk` only where Python code imports it; it does not provide the `ov` command. If the machine already runs the server (`uv tool install openviking`), that install ships `ov` as well, so no extra CLI install is needed there.
Verify:
@@ -125,7 +119,7 @@ On macOS and Linux, the global npm binary directory is usually `$(npm prefix -g)
OpenViking CLI configs can hold a user key, a root key, or both.
- User key: use this for normal data commands such as `ov add-resource`, `ov find`, and `ov tree`. The server derives the identity from the key, so you usually do not pass `--account` or `--user`. This is what most users want.
-- Root key: use this for admin work and commands that require `--sudo`. A root key has no built-in tenant identity. If a config only has a root key, it must also include `--account` and `--user`; that root key then serves normal commands for that identity and `--sudo` commands.
+- Root key: use this for admin work and commands that require `--sudo`. In `api_key` mode, root keys cannot access tenant data, even with `--account` and `--user`. Only a `trusted` server accepts those identity headers for root-key-authenticated data access.
- User key plus root key: use this when the same config should support daily data work and occasional admin work. Normal commands use the user key. `--sudo` commands use the root key with the configured account and user.
## Manual Setup
@@ -302,13 +296,13 @@ printf '%s' "$API_KEY" | ov config add custom --name <CONFIG-NAME> --url <REMOTE
Write the API key to stdin. If the key is already in the shell environment, use `--api-key-env <API-KEY-ENV-VAR>` instead.
-For a custom server where the user gives you only a root API key, include the target account and user:
+For a custom server in `trusted` mode, a root-only config must include the target account and user. For an `api_key` server, obtain a user/admin key for normal data commands instead:
```bash
ov config add custom --name <CONFIG-NAME> --url <REMOTE-OPENVIKING-URL> --root-api-key-stdin --account <ACCOUNT-ID> --user <USER-ID> --activate -o json
```
-Write the root API key to stdin. Root keys require explicit `--account` and `--user` so normal CLI commands know which identity to use.
+Write the trusted deployment's root API key to stdin. The account and user identify the caller for trusted data requests.
For a custom server where the user has both a user key and a root key, store both in one config:
diff --git a/docs/en/guides/04-authentication.md b/docs/en/guides/04-authentication.md
index 20af8d719..5be3f92b4 100644
--- a/docs/en/guides/04-authentication.md
+++ b/docs/en/guides/04-authentication.md
@@ -123,7 +123,7 @@ curl http://localhost:1933/api/v1/fs/ls?uri=viking:// \
**Python SDK (HTTP)**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(
url="http://localhost:1933",
@@ -608,7 +608,7 @@ curl http://localhost:1933/api/v1/fs/ls?uri=viking:// \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(
url="http://localhost:1933",
diff --git a/docs/zh/agent-integrations/09-log-ingestion.md b/docs/zh/agent-integrations/09-log-ingestion.md
index 2556f231c..5e1d982ec 100644
--- a/docs/zh/agent-integrations/09-log-ingestion.md
+++ b/docs/zh/agent-integrations/09-log-ingestion.md
@@ -31,6 +31,15 @@
## 在 ov.conf 中开启
+先在运行 ingest 命令的同一 shell 中设置以下变量。示例连接本地 dev 服务;认证部署应替换 URL,并使用绑定租户身份的 user/admin API Key:
+
+```bash
+export OPENVIKING_URL="http://localhost:1933"
+export OPENVIKING_API_KEY="" # 仅用于本地 dev;认证部署应填写 user/admin key。
+```
+
+配置加载器会展开这些变量。未设置的变量会保留为字面字符串,因此使用下面的占位值时不要跳过此步骤。
+
在 `ov.conf` 增加 `ingest` 段,列出要导入的 harness 并设置其模式:
```json
diff --git a/docs/zh/agent-integrations/11-pi.md b/docs/zh/agent-integrations/11-pi.md
index 7eca571f3..393a4bd04 100644
--- a/docs/zh/agent-integrations/11-pi.md
+++ b/docs/zh/agent-integrations/11-pi.md
@@ -43,8 +43,8 @@ bash <(curl -fsSL https://ovrelease.tos-cn-beijing.volces.com/memory-plugin-shar
git clone https://github.com/volcengine/OpenViking.git
cd OpenViking
node examples/memory-plugin-shared/sync.mjs
-mkdir -p ~/.pi/agent/extensions
-cp -r examples/pi-coding-agent-extension ~/.pi/agent/extensions/openviking
+mkdir -p ~/.pi/agent/extensions/openviking
+cp -R examples/pi-coding-agent-extension/. ~/.pi/agent/extensions/openviking/
```
扩展从 `shared/` 目录 import 共享模块,这个目录不在 git 里,由 `sync.mjs` 生成,所以复制前必须先运行它。之后 `git pull` 更新时,也要先重新运行 `sync.mjs` 再复制。
diff --git a/docs/zh/agent-integrations/15-agent-plugins.md b/docs/zh/agent-integrations/15-agent-plugins.md
index 30d178781..9837dcbde 100644
--- a/docs/zh/agent-integrations/15-agent-plugins.md
+++ b/docs/zh/agent-integrations/15-agent-plugins.md
@@ -15,6 +15,7 @@ agent-plugins/
│ └── shared/ # 由 examples/memory-plugin-shared/lib 生成
├── skills/openviking-memory/SKILL.md # 教模型完成「召回 + 沉淀」闭环
├── skills/ov-experience-memory/SKILL.md # 检索并应用以往任务的 Experience
+├── skills/ov-memory-troubleshoot/SKILL.md # 追溯记忆问题的会话依据
└── plugin.test.mjs # node --test 规范一致性校验
```
@@ -25,7 +26,7 @@ agent-plugins/
1. 准备一个可访问的 OpenViking 服务。还没有的话,先按 [快速开始](../getting-started/02-quickstart.md) 部署;本地默认端点是 `http://127.0.0.1:1933`。
2. 让你的 Agent Plugins 客户端指向 `agent-plugins/` 目录。各客户端的安装命令或插件目录不同,请查阅其文档。加载时客户端会:
- 按 `mcp.json` 注册名为 `openviking` 的 MCP server,以 stdio 方式运行 `node <plugin>/servers/mcp-proxy.mjs`;
- - 从 `skills/` 发现 `openviking-memory` 和 `ov-experience-memory` 技能。
+ - 从 `skills/` 发现 `openviking-memory`、`ov-experience-memory` 和 `ov-memory-troubleshoot` 技能。
3. 配置凭据(见下节)后开始会话。模型即可使用 `find` / `search` / `read` / `list` / `grep` / `glob` / `remember` / `add_resource` / `forget` / `health`,较新的服务端还提供 `tree` / `write` / `edit`。
## 为什么用 stdio 代理,而不是 `streamable-http`
diff --git a/docs/zh/api/01-overview.md b/docs/zh/api/01-overview.md
index cc9f02c54..ceee36682 100644
--- a/docs/zh/api/01-overview.md
+++ b/docs/zh/api/01-overview.md
@@ -17,6 +17,12 @@ Client-Server 模式通过 HTTP API 连接 OpenViking 服务器,支持多租
#### Python SDK 客户端
+先在运行代码的 Python 环境中安装独立 SDK:
+
+```bash
+python -m pip install --upgrade openviking-sdk
+```
+
```python
from openviking_sdk import SyncHTTPClient
@@ -110,32 +116,32 @@ export OPENVIKING_CLI_CONFIG_FILE=/path/to/ovcli.conf
| `api_key` | API Key | `null`(无认证) |
| `account` | 租户级请求的默认账户请求头 | `null` |
| `user` | 租户级请求的默认用户请求头 | `null` |
-| `timeout` | HTTP 请求超时时间(秒) | `600.0` |
+| `timeout` | HTTP 请求超时时间(秒) | `60.0` |
| `output` | 默认输出格式:`"table"` 或 `"json"` | `"table"` |
详细内容请参见 [配置指南](../guides/01-configuration.md#ovcli-conf)。
#### 完全不依赖配置文件使用 Python SDK 客户端
-`SyncHTTPClient` 和 `AsyncHTTPClient` 支持完全不依赖 `ovcli.conf` 配置文件,只需在初始化时**显式传入所有参数**即可:
+`SyncHTTPClient` 和 `AsyncHTTPClient` 可以在没有 `ovcli.conf` 文件时使用。先在运行代码的 Python 环境中安装独立 SDK:
+
+```bash
+python -m pip install --upgrade openviking-sdk
+```
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(
- url="http://localhost:1933", # 显式传入
- api_key="your-key", # 显式传入(默认情况下 api_key 已经能标识用户身份)
- timeout=30.0, # 不要用默认值 600.0
- extra_headers={} # 传空 dict 而不是 None,可用于某些场景的网关认证等
+ url="http://localhost:1933",
+ api_key="your-key",
+ timeout=30.0,
+ extra_headers={},
)
client.initialize()
```
-⚠️ **注意**:只要以下任一条件满足,客户端就会尝试加载配置文件:
-- `url` 为 `None`
-- `api_key` 为 `None`
-- `timeout` 等于 `600.0`(默认值)
-- `extra_headers` 为 `None`
+即使显式传入参数,SDK 仍会读取已有的 `ovcli.conf`。显式值覆盖对应配置,其他设置可能来自环境变量或配置文件,因此无效配置仍会导致客户端构造失败。默认超时为 60 秒。文件位置见[客户端配置](../configuration/02-client.md)。
#### HTTP 调用示例
@@ -155,12 +161,12 @@ curl http://localhost:1933/api/v1/fs/ls?uri=viking:// \
#### CLI 模式
-OpenViking CLI (可简写为 ov 命令)连接到 OpenViking 服务端,将所有操作暴露为 Shell 命令。CLI 同样从 `ovcli.conf` 读取连接信息(与 HTTP 客户端共享)。
+OpenViking CLI 的命令是 `ov`(通过 `npm install -g @openviking/cli` 安装),连接到 OpenViking 服务端,将所有操作暴露为 Shell 命令。CLI 同样从 `ovcli.conf` 读取连接信息(与 HTTP 客户端共享)。
基本用法:
```bash
-openviking [全局选项] <command> [参数] [命令选项]
+ov [全局选项] <command> [参数] [命令选项]
```
全局选项(必须放在命令名之前):
@@ -173,7 +179,7 @@ openviking [全局选项] <command> [参数] [命令选项]
示例:
```bash
-openviking -o json ls viking://resources/
+ov -o json ls viking://resources/
```
## 生命周期
@@ -181,7 +187,7 @@ openviking -o json ls viking://resources/
### Client-Server 模式
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933")
client.initialize()
@@ -194,7 +200,7 @@ client.close()
CLI 则直接通过命令行调用,需要先配置 ovcli.conf 文件,无需额外初始化客户端:
```
-openviking -o json ls viking://resources/
+ov -o json ls viking://resources/
```
## 认证
@@ -248,18 +254,24 @@ Python HTTP SDK(`SyncHTTPClient` 和 `AsyncHTTPClient`)会把该 envelope
列表数据渲染为表格,非列表数据 fallback 到格式化 JSON:
```bash
-openviking ls viking://resources/
+ov ls viking://resources/
# name size mode isDir uri
# .abstract.md 100 420 false viking://resources/.abstract.md
```
### JSON 模式(`--output json`)
-所有命令输出格式化 JSON,与 API 响应的 `result` 结构一致:
+`-o json` 默认使用紧凑输出,并带有 `{ok, result}` 包装:
+
+```bash
+ov -o json ls viking://resources/
+# {"ok":true,"result":[{"name":"...","size":100,...},...]}
+```
+
+使用 `--compact=false` 返回不带包装的格式化 JSON:
```bash
-openviking -o json ls viking://resources/
-# [{ "name": "...", "size": 100, ... }, ...]
+ov -o json --compact=false ls viking://resources/
```
可在 `ovcli.conf` 中设置默认输出格式:
@@ -271,7 +283,7 @@ openviking -o json ls viking://resources/
}
```
-### 紧凑模式(`--compact`, `-c`)
+### 紧凑模式(`--compact`, `-c`,默认开启)
- 当 `--output=json` 时:紧凑 JSON 格式 + `{ok, result}` 包装,适用于脚本
- 当 `--output=table` 时:对表格输出采取精简表示(如去除空列等)
diff --git a/docs/zh/api/04-skills.md b/docs/zh/api/04-skills.md
index 196779d65..65166a6f3 100644
--- a/docs/zh/api/04-skills.md
+++ b/docs/zh/api/04-skills.md
@@ -322,7 +322,7 @@ curl -X POST http://localhost:1933/api/v1/skills \
**Python SDK**:
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
client.initialize()
diff --git a/docs/zh/api/05-sessions.md b/docs/zh/api/05-sessions.md
index 8071461a4..61c04e14f 100644
--- a/docs/zh/api/05-sessions.md
+++ b/docs/zh/api/05-sessions.md
@@ -96,7 +96,7 @@ curl -X POST http://localhost:1933/api/v1/sessions \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
# 使用 HTTP 客户端
client = ov.AsyncHTTPClient(url="http://localhost:1933", api_key="your-key")
@@ -305,7 +305,7 @@ curl -X GET http://localhost:1933/api/v1/sessions/a1b2c3d4 \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.AsyncHTTPClient(url="http://localhost:1933", api_key="your-key")
await client.initialize()
@@ -730,7 +730,7 @@ curl -X GET "http://localhost:1933/api/v1/sessions/a1b2c3d4/context?token_budget
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.AsyncHTTPClient(url="http://localhost:1933", api_key="your-key")
await client.initialize()
@@ -840,7 +840,7 @@ curl -X GET "http://localhost:1933/api/v1/sessions/a1b2c3d4/archives/archive_002
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.AsyncHTTPClient(url="http://localhost:1933", api_key="your-key")
await client.initialize()
@@ -958,7 +958,7 @@ curl -X DELETE http://localhost:1933/api/v1/sessions/a1b2c3d4 \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.AsyncHTTPClient(url="http://localhost:1933", api_key="your-key")
await client.initialize()
@@ -1116,7 +1116,7 @@ curl -X POST http://localhost:1933/api/v1/sessions/a1b2c3d4/messages \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
from openviking_sdk import ContextPart, TextPart
client = ov.AsyncHTTPClient(url="http://localhost:1933", api_key="your-key")
diff --git a/docs/zh/api/06-retrieval.md b/docs/zh/api/06-retrieval.md
index 169aa01b9..467550cec 100644
--- a/docs/zh/api/06-retrieval.md
+++ b/docs/zh/api/06-retrieval.md
@@ -182,8 +182,7 @@ Tags 必须使用严格的 `k=v` 字符串。传入多个 tags 时,`find()`
**Python SDK**
```python
-import openviking as ov
-from openviking.retrieve import ContextType
+import openviking_sdk as ov
from openviking_sdk import TextPart
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
@@ -205,7 +204,7 @@ recent_emails = client.find(
# 仅搜索 memories 和 resources
typed_results = client.find(
query="authentication",
- options={"context_type": [ContextType.MEMORY, ContextType.RESOURCE]},
+ options={"context_type": ["memory", "resource"]},
)
# 按本地图片、bytes、data URI、HTTP URL 或 viking:// URI 搜索
@@ -461,8 +460,7 @@ curl -X POST http://localhost:1933/api/v1/search/search \
**Python SDK**
```python
-import openviking as ov
-from openviking.retrieve import ContextType
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
client.initialize()
@@ -484,7 +482,7 @@ results = client.search(
query="best practices",
session_id=session.session_id,
options={
- "context_type": ContextType.SKILL,
+ "context_type": "skill",
"since": "2h",
},
)
@@ -839,7 +837,7 @@ curl -X POST http://localhost:1933/api/v1/search/grep \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
client.initialize()
@@ -981,7 +979,7 @@ curl -X POST http://localhost:1933/api/v1/search/glob \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
client.initialize()
@@ -1063,7 +1061,7 @@ openviking glob "**/*.md" -f tags
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
client.initialize()
@@ -1107,7 +1105,7 @@ curl -X GET "http://localhost:1933/api/v1/content/read?uri=viking://resources/do
### 使用具体的查询
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
client.initialize()
@@ -1122,7 +1120,7 @@ results = client.find(query="auth")
### 限定搜索范围
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
client.initialize()
@@ -1137,7 +1135,7 @@ results = client.find(
### 在对话中使用会话上下文
```python
-import openviking as ov
+import openviking_sdk as ov
from openviking_sdk import TextPart
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
diff --git a/docs/zh/api/07-system.md b/docs/zh/api/07-system.md
index bb8240148..32a8f7114 100644
--- a/docs/zh/api/07-system.md
+++ b/docs/zh/api/07-system.md
@@ -57,7 +57,7 @@ curl -G http://localhost:1933/health \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933")
client.initialize()
diff --git a/docs/zh/api/08-admin.md b/docs/zh/api/08-admin.md
index 5c25bb207..90fa8d979 100644
--- a/docs/zh/api/08-admin.md
+++ b/docs/zh/api/08-admin.md
@@ -478,7 +478,7 @@ curl -X POST http://localhost:1933/api/v1/admin/accounts \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-key>")
client.initialize()
@@ -611,7 +611,7 @@ curl -X GET "http://localhost:1933/api/v1/admin/accounts?limit=50&page=2" \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-key>")
client.initialize()
@@ -717,7 +717,7 @@ curl -X DELETE http://localhost:1933/api/v1/admin/accounts/acme \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-key>")
client.initialize()
@@ -827,7 +827,7 @@ curl -X POST http://localhost:1933/api/v1/admin/accounts/acme/users \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-or-admin-key>")
client.initialize()
@@ -973,7 +973,7 @@ curl -X GET "http://localhost:1933/api/v1/admin/accounts/acme/users?limit=50&pag
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-or-admin-key>")
client.initialize()
@@ -1076,7 +1076,7 @@ curl -X DELETE http://localhost:1933/api/v1/admin/accounts/acme/users/bob \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-or-admin-key>")
client.initialize()
@@ -1176,7 +1176,7 @@ curl -X PUT http://localhost:1933/api/v1/admin/accounts/acme/users/bob/role \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-key>")
client.initialize()
@@ -1274,7 +1274,7 @@ curl -X POST http://localhost:1933/api/v1/admin/accounts/acme/users/bob/key \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(api_key="<root-or-admin-key>")
client.initialize()
diff --git a/docs/zh/api/14-ovpack.md b/docs/zh/api/14-ovpack.md
index 24de082fe..dab6037ea 100644
--- a/docs/zh/api/14-ovpack.md
+++ b/docs/zh/api/14-ovpack.md
@@ -68,7 +68,7 @@ curl -X POST http://localhost:1933/api/v1/pack/export \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-admin-key")
client.initialize()
@@ -202,7 +202,7 @@ curl -X POST http://localhost:1933/api/v1/pack/import \
**Python SDK**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(url="http://localhost:1933", api_key="your-admin-key")
client.initialize()
diff --git a/docs/zh/configuration/02-client.md b/docs/zh/configuration/02-client.md
index 1f226e22e..37ba7f7e0 100644
--- a/docs/zh/configuration/02-client.md
+++ b/docs/zh/configuration/02-client.md
@@ -70,8 +70,8 @@ export OPENVIKING_CLI_CONFIG_FILE=/path/to/ovcli.conf
| `url` | HTTP(S) URL | `http://127.0.0.1:1933` | OpenViking 服务端地址 |
| `api_key` | string / `null` | `null` | 普通数据操作使用的 user/admin key |
| `root_api_key` | string / `null` | `null` | `ov --sudo` 管理操作使用的 root key |
-| `account` | string / `null` | `null` | trusted 模式或 root-key-only 配置使用的账号身份 |
-| `user` | string / `null` | `null` | trusted 模式或 root-key-only 配置使用的用户身份 |
+| `account` | string / `null` | `null` | trusted 部署使用的账号身份 |
+| `user` | string / `null` | `null` | trusted 部署使用的用户身份 |
| `actor_peer_id` | string / `null` | `null` | 默认 Actor Peer 标识 |
| `agent_id` | string / `null` | `null` | 兼容字段;新配置使用 `actor_peer_id`,两者不能同时设置 |
| `extra_headers` | object / `null` | `null` | 每个 HTTP 请求附加的自定义请求头;`extra_header` 是兼容别名 |
@@ -82,7 +82,7 @@ export OPENVIKING_CLI_CONFIG_FILE=/path/to/ovcli.conf
| 配置方式 | 普通命令 | `ov --sudo` |
|---|---|---|
| 仅 `api_key` | 使用 user/admin key | 不可用 |
-| 仅 `root_api_key`,并配置 `account`、`user` | 使用 root key 和显式身份 | 使用 root key |
+| 仅 `root_api_key`,并配置 `account`、`user` | trusted 模式使用 root key 和显式身份;api_key 模式禁止访问租户数据 | 使用 root key |
| 同时配置两种 key | 使用 `api_key` | 使用 `root_api_key` |
| 两种 key 都不配置 | 仅适用于未开启鉴权的本地服务 | 不可用 |
@@ -107,7 +107,7 @@ export OPENVIKING_CLI_CONFIG_FILE=/path/to/ovcli.conf
| `show_progress` | boolean | `false` | 上传时是否默认显示进度 |
| `verbose` | boolean | `false` | 上传时是否默认输出诊断信息 |
| `profile` | boolean | `false` | 是否请求性能 profile;服务端还需启用 `server.profile_enabled` |
-| `output` | `"table"` / `"json"` | `"table"` | 兼容字段;当前命令使用 `-o table` 或 `-o json` 选择输出格式 |
+| `output` | `"table"` / `"json"` | `"table"` | 默认输出格式;当前命令的 `-o table` 或 `-o json` 会覆盖它 |
`--profile`、`--progress`、`--no-progress`、`--verbose` 等命令行参数会覆盖本次命令的配置。
diff --git a/docs/zh/getting-started/05-cli-setup.md b/docs/zh/getting-started/05-cli-setup.md
index 141e2fc54..566d0767b 100644
--- a/docs/zh/getting-started/05-cli-setup.md
+++ b/docs/zh/getting-started/05-cli-setup.md
@@ -43,7 +43,7 @@ CLI 使用 `~/.openviking/ovcli.conf` 作为 active 客户端连接配置。
- 服务端 URL 由用户或服务端管理员提供。
- 可能需要 API Key。
-- 只有 root key 的配置需要 `--account` 和 `--user`。
+- 仅用 root key 访问数据需要服务端采用 `trusted` 模式,并显式配置 `--account` 和 `--user`;`api_key` 模式的数据访问需要 user/admin key。
### 本地自定义
@@ -53,7 +53,7 @@ CLI 使用 `~/.openviking/ovcli.conf` 作为 active 客户端连接配置。
- 本地无鉴权服务通常不需要 API Key。
- 除非用户选择本地自定义配置,否则 Agent 不应探测本地端口、curl 本地 health endpoint,或运行启动服务端的命令。
-> **注意:** 最近的 CLI 版本(v0.3.23+)要求在运行大多数命令前先保存一个显示语言。在交互式终端中,CLI 会在首次使用时提示你选择;在非交互式 shell(Agent 或 CI)中,任何非豁免命令都会以 `2` 退出,直到你运行 `ov language en` 或 `ov language zh-CN`。只有 `ov language`/`ov lang`、`ov config add|edit|delete|list` 和 `ov config switch <name>` 是豁免的,因此请在上面的 `ov config validate`、`ov health` 和 `ov status` 之前先运行 `ov language <code>`。
+> **注意:** 最近的 CLI 版本(v0.3.23+)要求在运行大多数命令前先保存一个显示语言。在交互式终端中,CLI 会在首次使用时提示你选择;在非交互式 shell(Agent 或 CI)中,任何非豁免命令都会以 `2` 退出,直到你运行 `ov language en` 或 `ov language zh-CN`。只有 `ov language`/`ov lang`、`ov config add|edit|delete|list` 和 `ov config switch <name>` 是豁免的,因此请在下面的 `ov config validate`、`ov health` 和 `ov status` 检查之前先运行 `ov language <code>`。
## 开始前
@@ -98,13 +98,7 @@ npm i -g @openviking/cli
cargo install --git https://github.com/volcengine/OpenViking ov_cli
```
-npm 包是最轻量的独立 CLI 安装方式。如果你同时需要 Python SDK 或服务端包,Python 包也会提供 `ov`:
-
-```bash
-uv tool install openviking --upgrade
-# 或
-pip install openviking --upgrade --force-reinstall
-```
+npm 包是最轻量的独立 CLI 安装方式。Python SDK 是独立的包——只在有 Python 代码要 import 的地方安装 `openviking-sdk`,它不提供 `ov` 命令。如果这台机器本身跑服务端(`uv tool install openviking`),该安装自带 `ov`,无需再装 CLI。
验证:
@@ -125,7 +119,7 @@ npm prefix -g
OpenViking CLI 配置可以包含 user key、root key,或同时包含两者。
- User key:用于普通数据命令,例如 `ov add-resource`、`ov find` 和 `ov tree`。服务端会从 key 推导身份,所以通常不需要传 `--account` 或 `--user`。这是大多数用户需要的方式。
-- Root key:用于管理操作和需要 `--sudo` 的命令。Root key 自身不包含租户身份。如果一个配置只有 root key,就必须同时包含 `--account` 和 `--user`;这个 root key 会同时服务于该身份下的普通命令和 `--sudo` 命令。
+- Root key:用于管理操作和需要 `--sudo` 的命令。`api_key` 模式下,即使传入 `--account` 和 `--user`,root key 也不能访问租户数据。只有 `trusted` 服务端接受 root key 认证的数据请求通过这些 header 指定身份。
- User key + root key:适合一个配置同时支持日常数据操作和偶尔的管理操作。普通命令使用 user key,`--sudo` 命令使用 root key,并带上配置中的 account 和 user。
## 手动配置
@@ -302,13 +296,13 @@ printf '%s' "$API_KEY" | ov config add custom --name <CONFIG-NAME> --url <REMOTE
把 API Key 写入 stdin。如果 key 已经存在于当前 shell 环境变量中,可以改用 `--api-key-env <API-KEY-ENV-VAR>`。
-如果用户只提供 root API key,需要同时提供目标 account 和 user:
+对于 `trusted` 模式的自建服务,仅配置 root key 时还需提供目标 account 和 user。若服务端采用 `api_key` 模式,普通数据命令应改用 user/admin key:
```bash
ov config add custom --name <CONFIG-NAME> --url <REMOTE-OPENVIKING-URL> --root-api-key-stdin --account <ACCOUNT-ID> --user <USER-ID> --activate -o json
```
-把 root API key 写入 stdin。Root key 需要显式 `--account` 和 `--user`,这样普通 CLI 命令才知道以哪个身份执行。
+把 trusted 部署的 root API key 写入 stdin;account 和 user 用于指定 trusted 数据请求的调用者身份。
如果用户同时拥有 user key 和 root key,可以把两者放在同一个配置里:
diff --git a/docs/zh/guides/04-authentication.md b/docs/zh/guides/04-authentication.md
index a739fa6aa..0273018c6 100644
--- a/docs/zh/guides/04-authentication.md
+++ b/docs/zh/guides/04-authentication.md
@@ -524,7 +524,7 @@ curl http://localhost:1933/api/v1/fs/ls?uri=viking:// \
**Python SDK(HTTP)**
```python
-import openviking as ov
+import openviking_sdk as ov
client = ov.SyncHTTPClient(
url="http://localhost:1933",