Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
Python agent-contextagent-memoryagent-pluginsagentic-ragcontext-databasedsh-pluginknowledge-basememorymemory-managementself-evolvingvector-database
docs: split CLI setup page into a copyable agent prompt and manual steps (#5621)
Zayn Jarvis5e59d8eea6b1
diff --git a/docs/.vitepress/theme/components/AgentPrompt.vue b/docs/.vitepress/theme/components/AgentPrompt.vuenew file mode 100644index 000000000..77035bf08--- /dev/null+++ b/docs/.vitepress/theme/components/AgentPrompt.vue@@ -0,0 +1,109 @@+<script setup lang="ts">+// Collapsed prompt block whose header can copy the slotted code block+// without opening it. The prompt stays in the page DOM (and in llms.txt).+import { computed, ref } from 'vue'+import { useData } from 'vitepress'++const props = defineProps<{ label?: string }>()+const { lang } = useData()+const zh = computed(() => lang.value.startsWith('zh'))+const root = ref<HTMLDetailsElement>()+const copied = ref(false)+let timer: ReturnType<typeof setTimeout> | undefined++async function writeText(text: string) {+ try {+ await navigator.clipboard.writeText(text)+ } catch {+ const area = document.createElement('textarea')+ area.value = text+ area.setAttribute('readonly', '')+ area.style.cssText = 'position:fixed;opacity:0'+ document.body.appendChild(area)+ area.select()+ document.execCommand('copy')+ area.remove()+ }+}++async function copy() {+ const code = root.value?.querySelector('pre code')+ if (!code) return+ await writeText((code.textContent ?? '').replace(/\n$/, ''))+ copied.value = true+ clearTimeout(timer)+ timer = setTimeout(() => { copied.value = false }, 2000)+}+</script>++<template>+ <details ref="root" class="details custom-block agent-prompt">+ <summary>+ <span class="agent-prompt-label">{{ props.label ?? (zh ? '给 Agent 的提示词' : 'Prompt for your agent') }}</span>+ <button+ type="button"+ class="agent-prompt-copy"+ :class="{ copied }"+ :aria-label="zh ? '复制 Agent 提示词' : 'Copy the agent prompt'"+ @click.prevent.stop="copy"+ @keydown.enter.stop+ @keydown.space.stop+ >{{ copied ? (zh ? '已复制' : 'Copied') : (zh ? '复制' : 'Copy') }}</button>+ <span class="sr-only" aria-live="polite">{{ copied ? (zh ? '已复制' : 'Copied') : '' }}</span>+ </summary>+ <slot />+ </details>+</template>++<style scoped>+.agent-prompt > summary {+ display: flex;+ align-items: center;+ gap: 12px;+}+.agent-prompt > summary::-webkit-details-marker {+ display: none;+}+.agent-prompt > summary::before {+ content: '';+ width: 0;+ height: 0;+ border-block: 5px solid transparent;+ border-inline-start: 6px solid currentColor;+ transition: transform 0.2s;+}+.agent-prompt[open] > summary::before {+ transform: rotate(90deg);+}+.agent-prompt-label {+ flex: 1;+}+.agent-prompt-copy {+ padding: 2px 12px;+ border: 1px solid var(--vp-c-divider);+ border-radius: 6px;+ background: var(--vp-c-bg);+ color: var(--vp-c-text-1);+ font-size: 13px;+ font-weight: 500;+ line-height: 24px;+ transition: border-color 0.2s, color 0.2s;+}+.agent-prompt-copy:hover,+.agent-prompt-copy:focus-visible {+ border-color: var(--vp-c-brand-1);+ color: var(--vp-c-brand-1);+}+.agent-prompt-copy.copied {+ border-color: var(--vp-c-brand-1);+ color: var(--vp-c-brand-1);+}+.sr-only {+ position: absolute;+ width: 1px;+ height: 1px;+ overflow: hidden;+ clip: rect(0 0 0 0);+ white-space: nowrap;+}+</style>diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.tsindex fa734028d..c99b68389 100644--- a/docs/.vitepress/theme/index.ts+++ b/docs/.vitepress/theme/index.ts@@ -3,6 +3,7 @@ import { createLanguagePreference } from './language-preference.js'import { h, defineAsyncComponent } from 'vue'import DefaultTheme, { VPButton } from 'vitepress/theme-without-fonts'import DocBreadcrumb from './components/DocBreadcrumb.vue'+import AgentPrompt from './components/AgentPrompt.vue'import ArchitectureDiagram from './components/ArchitectureDiagram.vue'import IngestionPipelineDiagram from './components/IngestionPipelineDiagram.vue'import MemoryExtractionDiagram from './components/MemoryExtractionDiagram.vue'@@ -269,6 +270,7 @@ export default {},enhanceApp({ app, router }: EnhanceAppContext) {app.component('VPButton', VPButton)+ app.component('AgentPrompt', AgentPrompt)app.component('ArchitectureDiagram', ArchitectureDiagram)app.component('IngestionPipelineDiagram', IngestionPipelineDiagram)app.component('MemoryExtractionDiagram', MemoryExtractionDiagram)diff --git a/docs/en/getting-started/02-quickstart.md b/docs/en/getting-started/02-quickstart.mdindex 999ca712d..2712b7a49 100644--- a/docs/en/getting-started/02-quickstart.md+++ b/docs/en/getting-started/02-quickstart.md@@ -52,7 +52,7 @@ ov configIn the interactive configuration, choose **OpenViking Service** for Volcengine or **Custom** for a self-hosted endpoint. Enter the API key and, for a custom service, its URL. Leave the key empty for the default local server. Save and activate the configuration.-The CLI stores the active connection in `~/.openviking/ovcli.conf`. This is separate from the server's `ov.conf`. For scripted setup or multiple endpoints, see [CLI Setup](05-cli-setup.md).+The CLI stores the active connection in `~/.openviking/ovcli.conf`. This is separate from the server's `ov.conf`. For multiple endpoints or agent-assisted setup, see [CLI Setup](05-cli-setup.md).Verify the connection:@@ -64,34 +64,32 @@ This checks that the server responds; the import below also exercises model proc## 3. Import a document-Save the following as `quickstart.md` in your current directory:+This example imports a real team fact: the four GitHub users who take turns owning the weekly OpenViking release. Save the following as `ov-release-rotation.md` in your current directory:```markdown-# Project Atlas+# OpenViking release rotation-Project Atlas backs up its documents every Friday.-Maya owns the backup process. Keep each backup for 30 days.+OpenViking ships a new release every Friday.+Release owners rotate in this order: qin-ctx, zhoujh01, ZaynJarvis, t0saki.```Import it into a new resource directory:```bash-ov add-resource ./quickstart.md --to viking://resources/quickstart-demo --wait --timeout 120+ov add-resource ./ov-release-rotation.md --to viking://resources/ov-release-rotation --wait --timeout 120```The CLI uploads the local file automatically. `--wait` waits for processing; continue after the command succeeds. Without it, save the returned `task_id` and use `ov task status <task_id>` until the task is `completed`. See [Background Tasks](../api/17-tasks.md).-Use an unused target URI for this example. If you repeat the example, choose a new target and use that same URI in the commands below.-## 4. Browse and search```bash-ov tree viking://resources/quickstart-demo-ov overview viking://resources/quickstart-demo-ov find "Who owns the backup process?" --uri viking://resources/quickstart-demo+ov tree viking://resources/ov-release-rotation+ov overview viking://resources/ov-release-rotation+ov find "Who owns the weekly OpenViking release?" --uri viking://resources/ov-release-rotation```-`tree` lists the imported structure; `overview` reads its generated summary. `find` returns relevant context with URIs and scores. To read a match, pass its returned URI to `ov read`:+`tree` lists the imported structure; `overview` reads its generated summary. `find` returns relevant context with URIs and scores. The imported file answers the question, so it is the top match. To read a match, pass its returned URI to `ov read`:```bashov read "<returned-file-uri>"diff --git a/docs/en/getting-started/05-cli-setup.md b/docs/en/getting-started/05-cli-setup.mdindex 57d573c05..b8b276abb 100644--- a/docs/en/getting-started/05-cli-setup.md+++ b/docs/en/getting-started/05-cli-setup.md@@ -1,499 +1,286 @@# Install and use the CLI-This guide shows you how to install and configure the OpenViking CLI and use it to connect to an OpenViking server.+`ov` is the command-line client for OpenViking. OpenViking stores the context of your agents as a file system: resources, memories, and skills are directories and files under `viking://`. With `ov`, you can browse, read, search, and write this content. Agents use the same commands.-`ov` is the client CLI. It connects to an existing OpenViking server or to OpenViking Service (VolcEngine Cloud). It does not replace server setup. If you still need to install or start a custom OpenViking server, follow the [Quick Start](02-quickstart.md) first.+`ov` connects to an existing OpenViking server. If you do not have a server yet, do step 1 of the [Quick Start](02-quickstart.md) first.-Use this page in either of two ways:+## Set up with an agent-- If you are setting up `ov` yourself, follow [Manual Setup](#manual-setup).-- If you are asking an agent to set it up for you, give the agent this page and ask it to follow [Agent-Assisted Setup](#agent-assisted-setup).+Click **Copy** below and paste the prompt into your coding agent, for example Claude Code, Codex, or Cursor. The agent installs `ov`, asks you which server to use, and then saves the config and checks the connection.-The CLI evolves quickly. Use `ov --help` and `ov <command> --help` as the source of truth for the commands available in your installed version.+<AgentPrompt>-## What This Configures+````markdown+# openviking-cli-The CLI defaults to `~/.openviking/ovcli.conf`. When `OPENVIKING_CLI_CONFIG_FILE` is set, normal commands read that file. Named configuration management still operates on the default directory, so check the effective path after switching.+> `ov` is the command-line client for OpenViking, a context database for AI agents. It connects to an existing OpenViking server or to OpenViking Service on Volcengine.-When you create named configs, `ov` stores them next to the active file as `~/.openviking/ovcli.conf.<name>`. Switching configs copies the chosen saved config into `~/.openviking/ovcli.conf`.+I want you to install and configure the OpenViking CLI (`ov`) for me. Execute all the steps below autonomously. Stop and ask me only where a step says ASK.-`ov config` is the human-friendly interactive manager. It can add, edit, delete, validate, and switch configs.+OBJECTIVE: Install `ov`, save a named connection to my OpenViking server, and make it the active config.-`ov config add`, `ov config edit`, `ov config list`, `ov config switch <name>`, and `ov config delete` are deterministic commands for scripts and agents.+DONE WHEN: `ov config validate` shows every check as passed (config file valid, server reachable, auth accepted, healthy), and `ov health -o json` returns `"healthy": true`.-## Choose a Target+## TODO-Choose the OpenViking target before running setup commands.+- [ ] Install `ov` and set its display language+- [ ] Find out which server to connect to+- [ ] Save and activate a named config+- [ ] Verify the connection-Agents should ask the user which target they want unless it has already been specified. Existing configs, active configs, local files, default ports, and running services can inform follow-up questions, but they are not consent for the agent to choose a target, switch or replace configs, probe local services, start servers, or write data.+## Rules-### OpenViking Service (VolcEngine Cloud)+- You must not guess the target. Existing configs, local files, open ports, and running services are not my consent.+- You must ASK before you switch, replace, or delete a config, probe or start a local server, or write data.+- You must keep API keys out of command text, shell history, logs, memory, and printed config files. Pass a key only through stdin or through an environment variable that already exists.+- If you cannot pass a key that way, ASK me to run `ov config` and type the key myself.+- You must pass `--name` to `ov config add`, so that a retry updates the same config.+- You must add `-o json` to `ov config add|edit|list|switch|delete`. Branch on the exit code and `error.code`, not on prose.+- If the installed `ov --help` differs from this file, follow the installed help and tell me the difference.-Choose this when you want OpenViking hosted as a managed service on VolcEngine Cloud.+## Step 1: Install ov-- Server endpoint used by `ov`: `https://api.vikingdb.cn-beijing.volces.com/openviking`-- Console page for API keys: https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing-- In the console, go to User Management → API Key to view and copy your key.-- API key is required.-- Standard setup only needs the API key. Do not ask for `--account` or `--user` unless the user's administrator specifically provides identity override values.--### Remote Custom--Choose this when you connect to a custom OpenViking server hosted somewhere other than the current machine.--- Server URL is provided by the user or server administrator.-- API key may be required.-- 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--Choose this only when the user wants to connect to a custom OpenViking server on the current machine.--- Default local URL: `http://127.0.0.1:1933`-- 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`. In the current source, help requests, `ov language`/`ov lang`, `ov config add|edit|delete|list`, and `ov config switch <name>` bypass this gate, so run `ov language <code>` before the `ov config validate`, `ov health`, and `ov status` checks below.--## Before You Start--You need:--- A way to install the CLI:- - Node.js and npm for the standalone `@openviking/cli` package, or- - Python tooling if you install the full `openviking` package.-- A reachable OpenViking target:- - OpenViking Service (VolcEngine Cloud), or- - a custom OpenViking server.-- An API key if your target requires authentication.--API keys are sensitive. Prefer entering them through the interactive `ov config` prompt when you configure `ov` yourself. Only provide API keys to an agent through a channel you intentionally trust. The agent should pass the key through stdin and must not put it in shell commands, logs, long-term memory, or raw config output. Use an environment variable only when the key is already present in the shell environment.--## Install `ov`--Check whether `ov` is already installed:--```bash-command -v ov-ov --version-```--If `ov --version` or any other `ov` command says OpenViking needs a display language, choose one and retry:+You need Node.js and npm.```bash+command -v ov || npm i -g @openviking/cliov language en-# or-ov language zh-CN-```--Install or upgrade the npm package:--```bash-npm i -g @openviking/cli-```--Or build the Rust CLI from source:--```bash-cargo install --git https://github.com/volcengine/OpenViking ov_cli-```--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:--```bash-ov --help-```--If `ov` is still not found, close and reopen the shell, or check the npm global prefix:--```bash-npm prefix -g-```--On macOS and Linux, the global npm binary directory is usually `$(npm prefix -g)/bin`. Make sure that directory is on `PATH`.--## Key Types--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`. 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. Do not add `account` or `user` settings in API key mode.--## Manual Setup--Use this path when you are reading the guide and configuring `ov` yourself.--Run:--```bash-ov config+ov --version```-Then choose:+Use `ov language zh-CN` instead if I write to you in Chinese. Most `ov` commands exit with code 2 in a non-interactive shell until a display language is saved.-1. `Add config`-2. `OpenViking Service (VolcEngine Cloud)` or `Custom`-3. A config name, or leave it empty to generate one-4. The required URL and API key values for the target you chose above-5. Save the config after validation+If `ov` is not found after the install, add `$(npm prefix -g)/bin` to `PATH`. Do not use `sudo npm`. If npm is not available, ASK me before you build from source with `cargo install --git https://github.com/volcengine/OpenViking ov_cli`.-If you manage more than one OpenViking target, use:+Read the help for the commands you will use:```bash-ov config switch-```--to choose the active config later.--After setup, continue to [Verify The Setup](#verify-the-setup).--## Agent-Assisted Setup--Use this path when an agent is setting up `ov` for a user. The agent should read this whole page. The manual setup path above is the fallback when deterministic commands do not fit the user's environment.--### Agent Checklist--1. Ask which target the user wants unless it has already been specified: OpenViking Service (VolcEngine Cloud), remote custom, or local custom.-2. Do not infer the intended setup from existing configs, active configs, local files, default ports, or running services.-3. Ask before switching configs, replacing configs, probing local services, starting servers, or writing data.-4. Run `ov --help`, `ov config --help`, and the relevant config subcommand help before choosing commands. Select a display language with `ov language <code>` if none is saved.-5. If you have long-term memory and the user permits it, store a short summary of the current `ov --help` command surface. Do not store API keys or other secrets.-6. Use non-interactive `ov config` commands when the required values are known.-7. Always pass `--name` for agent setup so retries target the same saved config.-8. If the agent already holds the API key through a trusted channel, pass it with `--api-key-stdin` or `--root-api-key-stdin` and write only the key bytes to stdin. Use `--api-key-env` or `--root-api-key-env` only when that environment variable already exists. Do not ask the user to open a separate shell just to export a key for the agent.-9. Use `-o json` and branch on the JSON result plus the process exit code.-10. Validate the active config with `ov config validate`, then check `ov health` and `ov status`. Inspect the result contents; a zero exit code alone does not mean the service is healthy.-11. If non-interactive setup fails because values are missing, auth is unclear, or terminal input is safer, guide the user through `ov config` instead.--### Inspect the Installed CLI--Run:--```bash-ov --help-ov config --help-ov config add --helpov config add ov-service --helpov config add custom --help-ov config edit --help```-Use the installed CLI help as the source of truth. If this page and the installed help disagree, follow the installed help and tell the user what changed.+## Step 2: Find out the target-If a help command says OpenViking needs a display language, run `ov language en`, or `ov language zh-CN` if the user wants Chinese, then retry. Non-interactive config subcommands such as `ov config add`, `ov config list`, `ov config edit`, `ov config switch <name>`, and `ov config delete` can run before the display language is set.+Run `ov config list -o json`. If a saved config already matches the target, ASK me before you activate it with `ov config switch <NAME> -o json`.-### Use Stable Names for Retries+Otherwise ASK me which target to use, unless I already told you:-Always pass `--name` when an agent creates a config. If you omit it, `ov` generates a random name; a retry can create a second saved config instead of updating the intended one.+| Target | URL | API key |+|---|---|---|+| OpenViking Service (Volcengine) | Fixed. Do not pass `--url`. | Required. I get it in the [console](https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing) under User Management → API Key. |+| Remote custom server | ASK me. | ASK me. |+| Local custom server | `http://127.0.0.1:1933` | Usually none. |-`ov config add` is safe to run again with the same `--name` when the values are identical. It exits `0`, and `--activate` will make that saved config active again. If the same name already exists with different values, the command exits `3` and asks for `--force`.+For a local custom server only, check that it runs: `curl -fsS http://127.0.0.1:1933/health`. If the check fails, ASK me to start the server. See https://docs.openviking.ai/en/guides/03-deployment.-In the examples below, replace placeholders such as `<CONFIG-NAME>` and `<REMOTE-OPENVIKING-URL>` with user-approved values before running commands. Do not include the angle brackets.+Do not ask for `--account` or `--user` unless my administrator gave me these values.-### Reading Results+## Step 3: Save and activate the config-When you use `-o json` with the non-interactive config commands, successful results are printed to stdout:+Replace `<NAME>`, `<URL>`, and `<ENV_VAR>` with confirmed values. Remove the angle brackets. `$OV_API_KEY` stands for a trusted runtime source of the key, not the literal key.-```json-{"status":"ok","result":{"action":"add","name":"<CONFIG-NAME>"}}-```--The result object depends on the subcommand. `add` and `edit` also include fields such as `kind`, `url`, `saved_path`, `active_path`, `activated`, and `validation`, so agents should not assume that only `action` and `name` are present.--Errors are printed to stderr:--```json-{"status":"error","error":{"code":"bad_input","message":"..."}}-```--Agents should branch on the process exit code and the JSON `error.code`, not on human-readable prose.--| Exit code | Meaning |-|-----------|---------|-| `0` | Success, or already in the desired state |-| `2` | Bad input, missing value, invalid name, unreadable secret source, or no display language selected in a non-interactive shell (run `ov language <code>` first) |-| `3` | A config with that name already exists with different values; pass `--force` only if replacement is intended |-| `4` | Server unreachable or config validation failed |-| `5` | Authentication or key-role mismatch, such as passing a root key where a user key is expected |-| `6` | Refused operation, such as deleting the active config |--### List Existing Configs+OpenViking Service:```bash-ov config list -o json+printf '%s' "$OV_API_KEY" | ov config add ov-service --name <NAME> --api-key-stdin --activate -o json```-The list output shape is:--```json-{"status":"ok","result":[{"name":"<CONFIG-NAME>","kind":"OpenViking Service","url":"https://api.vikingdb.cn-beijing.volces.com/openviking","active":true}]}-```--For an existence check, inspect `result[].name`. To decide whether a config already needs switching, inspect the matching entry's `active` flag.--If a suitable saved config already exists, activate it by name:+Remote custom server with an API key:```bash-ov config switch <CONFIG-NAME> -o json+printf '%s' "$OV_API_KEY" | ov config add custom --name <NAME> --url <URL> --api-key-stdin --activate -o json```-Then run the verification commands.--### Add OpenViking Service--If the agent already holds the API key through a trusted channel, run:--```bash-ov config add ov-service --name <CONFIG-NAME> --api-key-stdin --activate -o json-```--A shell pipe has this shape:--```bash-printf '%s' "$API_KEY" | ov config add ov-service --name <CONFIG-NAME> --api-key-stdin --activate -o json-```--`$API_KEY` stands for a trusted runtime secret source, not the literal key. Use stdin when the agent can supply the key without putting it in the command text, shell history, logs, or a long-lived exported environment variable.--Write only the API key bytes to stdin. Do not place the key in the shell command. This writes an OpenViking Service config using the fixed endpoint `https://api.vikingdb.cn-beijing.volces.com/openviking`. The `ov-service` target does not take a custom server URL.--Use an environment variable only if it already exists in the shell:+Local custom server without authentication:```bash-ov config add ov-service --name <CONFIG-NAME> --api-key-env <API-KEY-ENV-VAR> --activate -o json+ov config add custom --name <NAME> --url http://127.0.0.1:1933 --activate -o json```-Do not pass `--account` or `--user` for standard OpenViking Service setup. Use them only when the user or their OpenViking administrator provides identity override values.+Special key cases:-### Add a Local Custom Server+- If the key is already in an environment variable, use `--api-key-env <ENV_VAR>` instead of `--api-key-stdin`.+- Root key only, on a server in `trusted` mode: use `--root-api-key-stdin --account <ACCOUNT> --user <USER>`. On a server in `api_key` mode, a root key cannot read data. ASK me for a user or admin key.+- User key and root key together: use `--api-key-stdin --root-api-key-env <ENV_VAR>`. A command has only one stdin, so the second key must come from an existing environment variable.-Use this path only after the user chooses local custom setup.+Exit codes of `ov config` subcommands:-For a local unauthenticated server:+| Code | Meaning | Your action |+|---|---|---|+| `0` | Success, or already in the target state | Continue. |+| `2` | Bad input, missing argument, or no display language | Fix the input, or run `ov language <code>`. |+| `3` | A config with this name exists with different content | ASK me before you add `--force`. |+| `4` | Server unreachable, or validation failed | ASK me to confirm the URL and that the server runs. |+| `5` | Authentication failed, or wrong key role | ASK me to confirm the key and key type. |+| `6` | Operation refused, for example deleting the active config | ASK me how to continue. |-```bash-ov config add custom --name <CONFIG-NAME> --url http://127.0.0.1:1933 --activate -o json-```+Do not retry with guessed values.-If the local server is not running, guide the user to start it first. See the [Deployment Guide](../guides/03-deployment.md).--### Add a Remote Custom Server--For a hosted custom server with a normal API key:+## Step 4: Verify```bash-ov config add custom --name <CONFIG-NAME> --url <REMOTE-OPENVIKING-URL> --api-key-stdin --activate -o json-```--The stdin pipe form is:--```bash-printf '%s' "$API_KEY" | ov config add custom --name <CONFIG-NAME> --url <REMOTE-OPENVIKING-URL> --api-key-stdin --activate -o json+ov config validate+ov health -o json```-Write the API key to stdin. If the key is already in the shell environment, use `--api-key-env <API-KEY-ENV-VAR>` instead.+Read the output. Exit code 0 alone does not prove that the server is healthy. To inspect the config, use `ov config show`, which hides secrets. Do not print `~/.openviking/ovcli.conf`.-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:+Do not import data as a demo unless I ask.-```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-```+After setup, I may ask you to browse, search, add, or organize content with `ov`. OpenViking content is a directory tree under `viking://`. To read, first use `ov abstract` or `ov overview` to read the directory summary. Then use `ov read` to read only the files you need. Run `ov --help` to see the command groups. Run `ov <command> --help` before you use a command.-Write the trusted deployment's root API key to stdin. The account and user identify the caller for trusted data requests.+EXECUTE NOW: Complete the above TODO list to achieve: `ov config validate` shows every check as passed, and `ov health -o json` returns `"healthy": true`.-For a custom server where the user has both a user key and a root key, store both in one config:+For more context, read https://docs.openviking.ai/llms.txt.+````-```bash-ov config add custom --name <CONFIG-NAME> --url <REMOTE-OPENVIKING-URL> --api-key-stdin --root-api-key-env <ROOT-API-KEY-ENV-VAR> --activate -o json-```+</AgentPrompt>-This keeps normal commands on the user key and lets `--sudo` commands use the root key. Because one command has only one stdin stream, the second key must come from an existing environment variable. If neither key is already available in the environment, use `ov config` and guide the user through the interactive flow.+The rest of this page describes manual setup.-### Edit or Replace a Config+## Before you start-List configs first:+You need Node.js and npm.-```bash-ov config list -o json-```--Rename and activate a saved config:--```bash-ov config edit <CONFIG-NAME> --new-name <NEW-CONFIG-NAME> --activate -o json-```--Replace an API key:--```bash-ov config edit <CONFIG-NAME> --api-key-stdin --activate -o json-```+You also need connection details. They depend on the server type:-Write the replacement API key to stdin.+| Server type | Server URL | API key |+|---|---|---|+| OpenViking Service (Volcengine) | Fixed. You do not enter it. | Required. Get it in the [OpenViking console](https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing) under **User Management → API Key**. |+| Remote self-hosted server | Get it from your administrator. | Get it from your administrator. |+| Self-hosted server on this machine | `http://127.0.0.1:1933` | Not needed for the default setup. |-Replace a custom server URL:+## 1. Install `ov````bash-ov config edit <CONFIG-NAME> --url <CUSTOM-OPENVIKING-URL> --activate -o json+npm i -g @openviking/cli+ov language en+ov --version```-Use `--force` only when you intentionally want to replace an existing saved config name.+`ov language` sets the display language. Use `zh-CN` for Chinese. Most commands do not run until you set a language.-### Delete a Saved Config+A machine that runs the OpenViking server already has `ov`. On that machine, skip `npm i` and only set the language.-Delete only non-active saved configs:+## 2. Add a connection```bash-ov config delete <OLD-CONFIG-NAME> -o json+ov config```-If the config is active, switch to another config first:+Follow the prompts:-```bash-ov config switch <CONFIG-NAME> -o json-ov config delete <OLD-CONFIG-NAME> -o json-```--## Verify the Setup+1. Select **Add Config**.+2. Select the server type. For OpenViking Service, select **OpenViking Service (VolcEngine Cloud)**. For a self-hosted server, select **Custom**.+3. Enter a name for the config. If you leave it empty, `ov` generates a name.+4. Enter the server URL and the API key that the prompts ask for.+5. After validation passes, select **Save and activate**.-Run:+## 3. Check the connection```bash-ov config show-ov config list -o jsonov config validate-ov health-ov status```-Use `ov config show` for inspection because it redacts secrets.--Do not print the raw config file unless you understand that it may contain secrets.--If a verification command says OpenViking needs a display language, run `ov language en`, or `ov language zh-CN` if the user wants Chinese, then rerun verification.+The connection works when all items under **Checks** pass: Config file `valid`, Server `reachable`, Auth `accepted`, and Health `healthy`.-`ov status` includes broader server and data diagnostics. Confirm that `ov config validate` succeeds and inspect the `healthy` value from `ov health`. Currently, `ov health` and table-mode `ov status` can exit 0 while reporting an unhealthy state, so automation must inspect the result. A status warning unrelated to connectivity does not necessarily mean CLI setup failed.+Setup is complete. Next, you can [import and retrieve your first document](02-quickstart.md#_3-import-a-document). To learn more, read on.-## Learn the Rest of the CLI+## What you can do with `ov`-After the config is working, use the built-in help to explore the rest of `ov`:+OpenViking content is a directory tree. Run `ov ls` to list the root, `viking://`:-```bash-ov --help-ov config --help-ov add-resource --help-```+- `viking://resources/`: imported documents, code repositories, and web pages. Shared in the account.+- `viking://user/<user-id>/`: your memories, private resources, skills, and sessions. `viking://~/` points to this directory.+- `viking://agent/`: skills and agent configuration, shared in the account.-Check the relevant help before unfamiliar commands, especially ingestion targets, asynchronous waiting, and deletion options.+Each directory has an L0 abstract and an L1 overview. The full text of a file is L2. Read the L0 and L1 of a directory first to decide if it is relevant. Then read only the L2 files that you need. For details, see [Viking URI](../concepts/04-viking-uri.md) and [Context Layers](../concepts/03-context-layers.md).-## Credential Safety+| Task | Commands |+|---|---|+| Browse | `ov ls`, `ov tree`, `ov stat`. `ov tui` opens an interactive browser. |+| Read by layer | `ov abstract` (L0), `ov overview` (L1), `ov read` (L2). `ov get` downloads a file to your machine. |+| Search | `ov find` (semantic search), `ov grep` (match content), `ov glob` (match paths) |+| Import documents and skills | `ov add-resource`, `ov add-skill`, `ov skills` |+| Write and organize | `ov write`, `ov mkdir`, `ov mv`, `ov cp`, `ov rm` |+| Extract memories from a conversation | `ov session new`, `ov session add-message`, `ov session commit`. `ov add-memory` does these three steps in one command. |+| Wait for background processing | `ov task list`, `ov task status`, `ov wait` |+| Save and roll back versions | `ov snapshot` |+| Back up and move data | `ov export`, `ov import`, `ov backup`, `ov restore` |+| Rebuild indexes (`viking://resources` needs an admin key) | `ov reindex` |+| Manage users (admin or root key) | `ov admin list-users`, `ov admin register-user`, `ov admin regenerate-key` |+| Check the server | `ov health`, `ov status` |-- API keys may grant access to your OpenViking data.-- Prefer the interactive `ov config` prompt for manual setup.-- For agent-assisted setup, provide API keys only through a channel you intentionally trust.-- Agents should pass keys through stdin. Use environment variables only when they already exist in the shell.-- Do not include API keys directly in shell commands that may be saved in shell history.-- Do not print raw `~/.openviking/ovcli.conf`.-- Do not share screenshots that reveal API keys.-- Use temporary or revocable keys for demos and trials.+After you import content or commit a session, the server processes it in the background: it parses content, extracts memories, generates L0 and L1, and builds indexes. Until processing is complete, `ov find` does not return the new content.-## Troubleshooting+Run `ov <command> --help` to see the options of a command. You can also ask your agent to do any of these tasks.-### `ov` Is Not Found+::: warning Caution+`ov rm -r` deletes a directory and all of its content. The delete runs on the server, so other agents that use the same server also lose this content. Before you delete, use `ov ls` to check the URI.+:::-Run:+## Manage several connections```bash-npm i -g @openviking/cli-npm prefix -g+ov config list # list saved configs+ov config switch # select the active config+ov config show # show the active config, with secrets hidden```-Then reopen the shell or add the global npm binary directory to `PATH`. On macOS and Linux, that directory is usually `$(npm prefix -g)/bin`.--### npm Global Install Fails+To edit or delete a config, run `ov config` and select the action. To add a config from a script, use `ov config add`. Run `ov config add --help` for the options.-If npm reports a permission error, use your normal Node.js setup policy. Avoid `sudo npm i -g` unless you intentionally manage global npm packages with sudo.+The active config is `~/.openviking/ovcli.conf`. Each saved config is `~/.openviking/ovcli.conf.<name>`. If you set `OPENVIKING_CLI_CONFIG_FILE`, `ov` uses that file as the active config, and saved configs are in the same directory as that file. For all fields, see [Client Configuration](../configuration/02-client.md).-### Local Server Is Not Running+## API keys-Use this only when the user chose local custom setup. Then verify the server:--```bash-curl http://127.0.0.1:1933/health-```+When the server uses API key authentication, a key has one of three roles:-If it fails, start the server before configuring `ov`. See the [Deployment Guide](../guides/03-deployment.md).+- **User key**: for data commands, such as `ov add-resource` and `ov find`. Most users need only this key.+- **Admin key**: for data commands, and for managing the users of its account.+- **Root key**: for managing the whole server, for example to create accounts. In `api_key` mode, a root key cannot read or write account data.-### API Key Validation Fails+One config can hold a user key and a root key. Normal commands use the user key. `ov admin`, `ov system`, `ov reindex`, `ov task status`, and `ov task list` use the root key when you add `--sudo`. For details, see [Authentication](../guides/04-authentication.md).-Run `ov config` again and edit the config. For OpenViking Service, confirm the key came from the OpenViking console URL above. For custom servers, confirm whether the server requires authentication.+To keep API keys safe:-Agents should not keep retrying unknown keys. Ask the user to confirm the target type, server URL, key type, account, and user.+- Type the key in the `ov config` prompt. Do not put a key in a command, because the shell history keeps it.+- Use `ov config show` to look at a config. It hides secrets. Do not share the content or screenshots of `~/.openviking/ovcli.conf`.+- For demos and trials, use a temporary key that you can revoke.+- If an agent sets up `ov` for you, do not paste the key into the chat. Put the key in an environment variable, or run `ov config` yourself and type the key when the agent asks.-### The Wrong Config Is Active--Inspect and switch:--```bash-ov config show-ov config list-ov config switch-ov config validate-```--Agents can switch by name:--```bash-ov config list -o json-ov config switch <CONFIG-NAME> -o json-```--### Non-Interactive Setup Does Not Fit+## Troubleshooting-Use the interactive wizard:+### `ov` is not found-```bash-ov config-```+Open a new terminal. If `ov` is still not found, add the npm global binary directory to `PATH`. On macOS and Linux, this directory is usually `$(npm prefix -g)/bin`.-This is the right fallback when a secret should be typed directly by the user, when the target is unclear, or when validation needs human judgment.+### npm reports a permission error-### Old Setup Commands+Fix the permissions in the way you usually manage Node.js, for example with nvm. Do not run `sudo npm i -g` unless you always manage global packages that way.-Use `ov config`. Do not use old or removed setup commands such as `ov config setup-cli`.+### A command asks for a display language-## Next Steps+Run `ov language en` or `ov language zh-CN`. Then run the command again.-Once the CLI is configured, use `ov --help` and `ov <command> --help` to learn the rest of the CLI.+### The local server does not respond-Adding a resource writes data into the active OpenViking server. If you want a small demo, use a resource you are comfortable storing. Agents must ask the user for permission before running this kind of demo command. Connection verification alone does not require writing a resource.+Check the server:```bash-ov add-resource https://github.com/volcengine/OpenViking-# Use the returned task_id; search after its status reaches completed-ov task status TASK_ID-ov find "what is OpenViking"-ov tree viking://resources/ -L 2+curl http://127.0.0.1:1933/health```-For all commands:+If this fails, start the server first. See [Deployment](../guides/03-deployment.md).-```bash-ov --help-ov config --help-ov add-resource --help-```+### API key validation fails-## Rebuilding Indexes+Run `ov config`, select **Edit Config**, and enter the key again. For OpenViking Service, copy the key from the console. For a self-hosted server, ask your administrator for the correct key and key type. In `api_key` mode, data commands need a user key or an admin key.-`ov reindex <uri>` validates and repairs indexes for already-imported content. Three modes are available. Resource and skill records whose MD5 fingerprints already match are skipped by default:+### The wrong config is active-- `--mode vectors_only` — refresh vectors only.-- `--mode semantic_and_vectors` — regenerate semantic artifacts (`.abstract.md`, `.overview.md`) before refreshing vectors.+Run `ov config list` to see which config is active. Run `ov config switch` to select another one.-Both rebuild modes process the full subtree by default; add `--recursive=false` to process only the target itself. Add `--force` to bypass MD5 comparison and rebuild all resource/skill semantic and vector data in scope.+## Next steps-There is no `semantic` or `full` mode alias.+- Import and retrieve your first document: [Quick Start](02-quickstart.md).+- Connect OpenViking to the agent you use every day: [Agent integrations](../agent-integrations/01-overview.md).diff --git a/docs/en/guides/03-deployment.md b/docs/en/guides/03-deployment.mdindex b81834c89..8ff2e24b1 100644--- a/docs/en/guides/03-deployment.md+++ b/docs/en/guides/03-deployment.md@@ -403,8 +403,8 @@ This variant is useful when multiple instances share the same `workspace`, but QFor public HTTPS access, see the [Public Access Guide](12-public-access.md).-To build the image yourself, pass an explicit OpenViking version:-`docker build --build-arg OPENVIKING_VERSION=0.3.12 -t openviking:latest .`+To build the image yourself, pass an explicit OpenViking version. Replace `<VERSION>` with a release number:+`docker build --build-arg OPENVIKING_VERSION=<VERSION> -t openviking:latest .`### Kubernetes + Helmdiff --git a/docs/en/guides/08-encryption.md b/docs/en/guides/08-encryption.mdindex 1b3bdb84a..c10ad8926 100644--- a/docs/en/guides/08-encryption.md+++ b/docs/en/guides/08-encryption.md@@ -96,36 +96,13 @@ File encryption and API key hashing are independent controls:| **File Layer** | `encryption.enabled` | AES-GCM | Yes | Protects entire storage files || **API Key Field Layer** | `encryption.api_key_hashing.enabled` | Argon2id | No | Protects API keys themselves |-### Upgrading from implicit API key hashing--Applies when upgrading from v0.3.12 or earlier to v0.3.13 or later.--**Behavior Change**:-- **Before**: `encryption.enabled = true` implicitly enabled API key Argon2id hashing-- **Now**: You must explicitly configure `encryption.api_key_hashing.enabled`--**Impact**:-- After upgrade, if `encryption.enabled = true` but `encryption.api_key_hashing.enabled` is not explicitly set to `true`, you will see the following informational log excerpt on startup:- ```- API key hashing is disabled while file encryption is enabled.- Previously, encryption.enabled=true implicitly enabled API key Argon2id hashing.- Now, API keys will be stored in plaintext within AES-GCM encrypted files.- To maintain the previous behavior, set encryption.api_key_hashing.enabled=true.- ```--**Migration Options**:--| Option | Config | Behavior |-|--------|--------|----------|-| **Maintain Previous Behavior** | `api_key_hashing.enabled = true` | API keys stored using Argon2id hashing |-| **Recoverable key storage (default)** | `api_key_hashing.enabled = false` (default) | API keys stored in plaintext (file layer still encrypted) |-### Default Behavior**By default, `encryption.api_key_hashing.enabled = false`**:- API keys are stored in plaintext within JSON files- If `encryption.enabled = true`, the entire file is protected by AES-GCM encryption- `ov admin list-users` can display the full API key+- If `encryption.enabled = true` and API key hashing stays disabled, the server writes an informational log line about this at startup### Enabling Argon2id Hashingdiff --git a/docs/zh/getting-started/02-quickstart.md b/docs/zh/getting-started/02-quickstart.mdindex 506558f73..46de4ead5 100644--- a/docs/zh/getting-started/02-quickstart.md+++ b/docs/zh/getting-started/02-quickstart.md@@ -52,7 +52,7 @@ ov config在交互配置中,火山托管服务选择 **OpenViking Service**,自建服务选择 **自定义(Custom)**。填写 API Key,自建服务还需填写 URL。默认本地服务的密钥留空。保存并激活配置。-CLI 将当前连接保存到 `~/.openviking/ovcli.conf`,它与服务端的 `ov.conf` 是两个文件。脚本化配置和多服务切换见 [CLI 配置](05-cli-setup.md)。+CLI 将当前连接保存到 `~/.openviking/ovcli.conf`,它与服务端的 `ov.conf` 是两个文件。多服务切换和让 Agent 配置见 [CLI 配置](05-cli-setup.md)。检查连接:@@ -64,34 +64,32 @@ ov health## 3. 导入文档-在当前目录创建 `quickstart.md`,内容如下:+本例导入一条真实的团队信息:OpenViking 每周发布由哪四位 GitHub 用户轮流负责。在当前目录创建 `ov-release-rotation.md`,内容如下:```markdown-# Atlas 项目+# OpenViking 发布轮值-Atlas 项目每周五备份文档。-Maya 负责备份流程,每份备份保留 30 天。+OpenViking 每周五发布一个新版本。+发布负责人按顺序轮换:qin-ctx、zhoujh01、ZaynJarvis、t0saki。```将它导入新的资源目录:```bash-ov add-resource ./quickstart.md --to viking://resources/quickstart-demo --wait --timeout 120+ov add-resource ./ov-release-rotation.md --to viking://resources/ov-release-rotation --wait --timeout 120```CLI 会自动上传本地文件。`--wait` 等待处理完成,命令成功后再继续。若省略该参数,保存返回的 `task_id`,用 `ov task status <task_id>` 查询到 `completed` 后再使用结果。详见[后台任务](../api/17-tasks.md)。-本例使用尚未使用的目标 URI。重复运行示例时,换一个新目标,并同步替换下方命令中的 URI。-## 4. 浏览与检索```bash-ov tree viking://resources/quickstart-demo-ov overview viking://resources/quickstart-demo-ov find "谁负责备份流程?" --uri viking://resources/quickstart-demo+ov tree viking://resources/ov-release-rotation+ov overview viking://resources/ov-release-rotation+ov find "谁负责 OpenViking 的每周发布?" --uri viking://resources/ov-release-rotation```-`tree` 列出导入后的结构,`overview` 读取生成的概览,`find` 返回相关上下文的 URI 和分数。读取某条命中时,把返回的 URI 传给 `ov read`:+`tree` 列出导入后的结构,`overview` 读取生成的概览,`find` 返回相关上下文的 URI 和分数。这个问题的答案就在导入的文件中,所以该文件排在结果第一位。读取某条命中时,把返回的 URI 传给 `ov read`:```bashov read "<returned-file-uri>"diff --git a/docs/zh/getting-started/05-cli-setup.md b/docs/zh/getting-started/05-cli-setup.mdindex 35b85dc7b..01b85b99a 100644--- a/docs/zh/getting-started/05-cli-setup.md+++ b/docs/zh/getting-started/05-cli-setup.md@@ -1,499 +1,286 @@# 安装与使用 CLI-本文介绍如何安装和配置 OpenViking CLI,并使用它连接到 OpenViking 服务端。+`ov` 是 OpenViking 的命令行客户端。OpenViking 把 Agent 的上下文存成一个文件系统:资源、记忆和技能都是 `viking://` 下的目录和文件。用 `ov` 可以浏览、读取、检索和写入这些内容。Agent 也用同样的命令操作这些内容。-`ov` 是客户端 CLI。它连接到已经存在的 OpenViking 服务端,或连接到 OpenViking Service(火山引擎云)。它不是服务端安装命令。如果你还没有安装或启动自定义 OpenViking 服务端,请先阅读[快速开始](02-quickstart.md)。+`ov` 连接一个已有的 OpenViking 服务。还没有服务时,先完成[快速开始](02-quickstart.md)的第 1 步。-你可以用两种方式阅读本文:+## 让 Agent 配置-- 如果你自己手动配置 `ov`,请阅读[手动配置](#手动配置)。-- 如果你让 Agent 帮你配置,请把本文发给 Agent,并让它阅读 [Agent 辅助配置](#agent-辅助配置)。+点击下方的**复制**,把提示词粘贴给你使用的编程 Agent,例如 Claude Code、Codex 或 Cursor。Agent 会安装 `ov`,向你确认要连接的服务,然后保存配置并检查连接。-CLI 会持续演进。请把 `ov --help` 和 `ov <command> --help` 作为当前安装版本的命令准确信息来源。+<AgentPrompt>-## 本文配置什么+````markdown+# openviking-cli-CLI 默认使用 `~/.openviking/ovcli.conf`。若设置了 `OPENVIKING_CLI_CONFIG_FILE`,普通命令读取该变量指定的文件;命名配置管理仍操作默认目录,切换后需确认实际生效的路径。+> `ov` 是 OpenViking 的命令行客户端。OpenViking 是面向 AI Agent 的上下文数据库。`ov` 连接已有的 OpenViking 服务端,或连接火山引擎上的 OpenViking 服务。-创建命名配置时,`ov` 会把配置保存为 `~/.openviking/ovcli.conf.<name>`。切换配置时,`ov` 会把选中的已保存配置复制到 `~/.openviking/ovcli.conf`。+我希望你为我安装并配置 OpenViking CLI(`ov`)。自主执行下面的全部步骤。只在步骤标注 ASK 的地方停下来问我。-`ov config` 是面向人的交互式配置管理器,可以新增、编辑、删除、校验和切换配置。+OBJECTIVE:安装 `ov`,为我的 OpenViking 服务保存一个命名配置,并把它设为当前配置。-`ov config add`、`ov config edit`、`ov config list`、`ov config switch <name>` 和 `ov config delete` 是面向脚本和 Agent 的确定性命令。+DONE WHEN:`ov config validate` 的检查项全部通过(配置文件有效、服务器可连接、认证已通过、健康),并且 `ov health -o json` 返回 `"healthy": true`。-## 选择连接目标+## TODO-运行配置命令前,先选择要连接的 OpenViking 目标。+- [ ] 安装 `ov` 并设置显示语言+- [ ] 确认要连接的服务+- [ ] 保存并激活命名配置+- [ ] 验证连接-除非用户已经明确说明,Agent 应先询问用户要连接哪种目标。已有配置、active 配置、本地文件、默认端口和正在运行的服务可以帮助 Agent 追问细节,但不代表用户同意 Agent 选择目标、切换或替换配置、探测本地服务、启动服务端,或写入数据。+## 规则-### OpenViking Service(火山引擎云)+- 你不能猜测连接目标。已有配置、本地文件、开放端口和正在运行的服务都不代表我的同意。+- 切换、替换或删除配置,探测或启动本地服务,或写入数据之前,你必须先 ASK 我。+- API Key 不能出现在命令文本、shell 历史、日志、记忆或打印出的配置文件中。只能通过 stdin 或已经存在的环境变量传入 key。+- 如果你无法用这两种方式传入 key,ASK 我自己运行 `ov config` 并输入 key。+- 运行 `ov config add` 时必须传 `--name`,这样重试会更新同一个配置。+- `ov config add|edit|list|switch|delete` 必须加 `-o json`。根据退出码和 `error.code` 判断结果,不要解析说明文字。+- 如果本机 `ov --help` 与本文不一致,以本机帮助为准,并告诉我差异。-如果你希望使用火山引擎云上的 OpenViking 托管服务,选择此项。+## 第 1 步:安装 ov-- `ov` 使用的服务端端点:`https://api.vikingdb.cn-beijing.volces.com/openviking`-- 管理 API Key 的控制台页面:https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing-- 在控制台进入 User Management → API Key,查看并复制你的 key。-- API Key 必填。-- 标准配置只需要 API Key。除非用户的管理员明确提供身份覆盖值,否则不要询问 `--account` 或 `--user`。--### 远程自定义--如果你要连接不在当前机器上的自定义 OpenViking 服务端,选择此项。--- 服务端 URL 由用户或服务端管理员提供。-- 可能需要 API Key。-- 仅用 root key 访问数据需要服务端采用 `trusted` 模式,并显式配置 `--account` 和 `--user`;`api_key` 模式的数据访问需要 user/admin key。--### 本地自定义--只有当用户要连接当前机器上的自定义 OpenViking 服务端时,才选择此项。--- 本地默认 URL:`http://127.0.0.1:1933`-- 本地无鉴权服务通常不需要 API Key。-- 除非用户选择本地自定义配置,否则 Agent 不应探测本地端口、curl 本地 health endpoint,或运行启动服务端的命令。--> **注意:** 最近的 CLI 版本(v0.3.23+)要求在运行大多数命令前先保存一个显示语言。在交互式终端中,CLI 会在首次使用时提示你选择;在非交互式 shell(Agent 或 CI)中,任何非豁免命令都会以 `2` 退出,直到你运行 `ov language en` 或 `ov language zh-CN`。当前源码中的 help 请求、`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 的方式:- - 使用 Node.js 和 npm 安装独立的 `@openviking/cli` 包,或- - 使用 Python 工具安装完整的 `openviking` 包。-- 一个可访问的 OpenViking 目标:- - OpenViking Service(火山引擎云),或- - 自定义 OpenViking 服务端。-- 如果目标需要鉴权,需要准备 API Key。--API Key 是敏感凭证。手动配置时优先通过 `ov config` 的交互式输入框输入。只有当你明确相信当前渠道时,才把 API Key 提供给 Agent。Agent 应通过 stdin 传入 key,不能把 key 写进 shell 命令、日志、长期记忆或原始配置输出。只有当 key 已经存在于当前 shell 环境变量中时,才使用环境变量。--## 安装 `ov`--先检查是否已经安装:--```bash-command -v ov-ov --version-```--如果 `ov --version` 或任何其他 `ov` 命令提示 OpenViking 需要显示语言,请先选择语言再重试:+需要 Node.js 和 npm。```bash-ov language en-# 或+command -v ov || npm i -g @openviking/cliov language zh-CN+ov --version```-安装或升级 npm 包:--```bash-npm i -g @openviking/cli-```--也可以从源码构建 Rust CLI:--```bash-cargo install --git https://github.com/volcengine/OpenViking ov_cli-```--npm 包是最轻量的独立 CLI 安装方式。Python SDK 是独立的包——只在有 Python 代码要 import 的地方安装 `openviking-sdk`,它不提供 `ov` 命令。如果这台机器本身跑服务端(`uv tool install openviking`),该安装自带 `ov`,无需再装 CLI。--验证:--```bash-ov --help-```--如果仍然找不到 `ov`,关闭并重新打开 shell,或检查 npm 全局 prefix:--```bash-npm prefix -g-```--在 macOS 和 Linux 上,全局 npm binary 目录通常是 `$(npm prefix -g)/bin`。确认该目录已经加入 `PATH`。--## 密钥类型--OpenViking CLI 配置可以包含 user key、root key,或同时包含两者。--- User key:用于普通数据命令,例如 `ov add-resource`、`ov find` 和 `ov tree`。服务端会从 key 推导身份,所以通常不需要传 `--account` 或 `--user`。这是大多数用户需要的方式。-- Root key:用于管理操作和需要 `--sudo` 的命令。`api_key` 模式下,即使传入 `--account` 和 `--user`,root key 也不能访问租户数据。只有 `trusted` 服务端接受 root key 认证的数据请求通过这些 header 指定身份。-- User key + root key:适合一个配置同时支持日常数据操作和偶尔的管理操作。普通命令使用 user key,`--sudo` 命令使用 root key。API key 模式不要额外配置 `account` 或 `user`。--## 手动配置--如果你正在阅读本文,并准备自己配置 `ov`,使用这个路径。--运行:--```bash-ov config-```--然后选择:+如果我用英文和你交流,改用 `ov language en`。未保存显示语言时,大多数 `ov` 命令在非交互式 shell 中以退出码 2 退出。-1. `Add config`-2. `OpenViking Service(火山引擎云)` 或 `自定义`-3. 配置名称,或留空自动生成-4. 上面选择的目标所需的 URL 和 API Key-5. 校验成功后保存配置+安装后仍找不到 `ov` 时,把 `$(npm prefix -g)/bin` 加入 `PATH`。不要使用 `sudo npm`。没有 npm 时,先 ASK 我,再用 `cargo install --git https://github.com/volcengine/OpenViking ov_cli` 从源码构建。-如果你维护多个 OpenViking 目标,之后可以使用:+查看要用到的命令帮助:```bash-ov config switch-```--切换 active 配置。--配置完成后,继续阅读[验证配置](#验证配置)。--## Agent 辅助配置--如果 Agent 正在替用户配置 `ov`,使用这个路径。Agent 应该阅读整篇文档。当确定性命令不适合用户环境时,上面的手动配置流程就是回退路径。--### Agent 检查清单--1. 除非用户已经明确说明,先询问用户要连接哪种目标:OpenViking Service(火山引擎云)、远程自定义,还是本地自定义。-2. 不要根据已有配置、active 配置、本地文件、默认端口或正在运行的服务推断用户想要的 setup。-3. 切换配置、替换配置、探测本地服务、启动服务端或写入数据前,都要先询问用户。-4. 在选择命令前,运行 `ov --help`、`ov config --help` 和相关 config 子命令的帮助。如果还没有保存显示语言,运行 `ov language <code>`。-5. 如果你具备长期记忆能力,并且用户允许,可以记录当前 `ov --help` 命令面的简要摘要。不要记录 API Key 或其他密钥。-6. 当必需信息明确时,使用非交互式 `ov config` 命令。-7. Agent 配置时始终传 `--name`,这样重试会命中同一个 saved config。-8. 如果 Agent 已经通过可信渠道拿到 API Key,使用 `--api-key-stdin` 或 `--root-api-key-stdin`,并且只把 key 内容写入 stdin。只有当环境变量已经存在时,才使用 `--api-key-env` 或 `--root-api-key-env`。不要要求用户额外打开一个 shell 只为了给 Agent export 一个 key。-9. 使用 `-o json`,并根据 JSON 结果和进程退出码分支处理。-10. 使用 `ov config validate` 校验 active 配置,然后运行 `ov health` 和 `ov status`。要检查结果内容,退出码为 0 不代表服务健康。-11. 如果非交互式配置因为信息缺失、鉴权不明确或终端输入更安全而失败,请引导用户使用 `ov config` 交互式向导。--### 查看当前安装的 CLI--运行:--```bash-ov --help-ov config --help-ov config add --helpov config add ov-service --helpov config add custom --help-ov config edit --help```-以当前安装版本的 CLI 帮助为准。如果本文与本地帮助不一致,请遵循本地帮助,并告诉用户差异是什么。+## 第 2 步:确认连接目标-如果 help 命令提示 OpenViking 需要显示语言,请运行 `ov language en`;如果用户希望使用中文,则运行 `ov language zh-CN`,然后重试。`ov config add`、`ov config list`、`ov config edit`、`ov config switch <name>` 和 `ov config delete` 等非交互式 config 子命令可以在设置显示语言前运行。+运行 `ov config list -o json`。如果已有配置与目标一致,先 ASK 我,再用 `ov config switch <NAME> -o json` 激活它。-### 使用稳定名称便于重试+否则,除非我已经说明,ASK 我要连接哪种目标:-Agent 创建配置时始终传 `--name`。如果省略名称,`ov` 会随机生成名称;重试时可能创建第二个 saved config,而不是更新预期的配置。+| 目标 | 服务地址 | API Key |+|---|---|---|+| OpenViking 服务(火山引擎云) | 固定地址,不要传 `--url`。 | 必填。我在[控制台](https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing)的“用户管理 → API Key”中获取。 |+| 远程自建服务 | ASK 我。 | ASK 我。 |+| 本机自建服务 | `http://127.0.0.1:1933` | 通常不需要。 |-当传入相同 `--name` 且配置内容完全一致时,`ov config add` 可以安全重复运行。它会以 `0` 退出,`--activate` 也会再次把该 saved config 设为 active。如果同名配置已经存在但内容不同,命令会以 `3` 退出,并要求只有在确认替换时才使用 `--force`。+只有目标是本机自建服务时,才检查服务是否运行:`curl -fsS http://127.0.0.1:1933/health`。检查失败时,ASK 我启动服务端。参见 https://docs.openviking.ai/zh/guides/03-deployment 。-下面示例中的 `<CONFIG-NAME>` 和 `<REMOTE-OPENVIKING-URL>` 等占位符需要替换成用户确认过的值再运行。运行时不要保留尖括号。+除非我的管理员提供了 `--account` 和 `--user` 的值,否则不要询问这两项。-### 读取结果+## 第 3 步:保存并激活配置-对非交互式 config 命令使用 `-o json` 时,成功结果会输出到 stdout:+把 `<NAME>`、`<URL>` 和 `<ENV_VAR>` 替换为确认过的值,不保留尖括号。`$OV_API_KEY` 表示可信的运行时密钥来源,不是字面量 key。-```json-{"status":"ok","result":{"action":"add","name":"<CONFIG-NAME>"}}-```--`result` 对象会随子命令变化。`add` 和 `edit` 还会包含 `kind`、`url`、`saved_path`、`active_path`、`activated` 和 `validation` 等字段,因此 Agent 不应该假设结果里只有 `action` 和 `name`。--错误结果会输出到 stderr:--```json-{"status":"error","error":{"code":"bad_input","message":"..."}}-```--Agent 应该根据进程退出码和 JSON 中的 `error.code` 分支处理,不要解析面向人的说明文字。--| 退出码 | 含义 |-|--------|------|-| `0` | 成功,或已经处于目标状态 |-| `2` | 输入错误、缺少参数、名称非法、无法读取密钥来源,或在非交互式 shell 中尚未选择显示语言(请先运行 `ov language <code>`) |-| `3` | 同名配置已经存在但内容不同;只有确认要替换时才传 `--force` |-| `4` | 服务端不可达,或配置校验失败 |-| `5` | 鉴权或 key 角色不匹配,例如把 root key 传到了需要 user key 的位置 |-| `6` | 操作被拒绝,例如删除 active 配置 |--### 列出已有配置+OpenViking 服务:```bash-ov config list -o json+printf '%s' "$OV_API_KEY" | ov config add ov-service --name <NAME> --api-key-stdin --activate -o json```-列表输出形状如下:--```json-{"status":"ok","result":[{"name":"<CONFIG-NAME>","kind":"OpenViking Service","url":"https://api.vikingdb.cn-beijing.volces.com/openviking","active":true}]}-```--做存在性检查时,读取 `result[].name`。判断是否还需要切换 active config 时,读取匹配项的 `active` 标记。--如果已经存在合适的 saved config,可以按名称激活:+使用 API Key 的远程自建服务:```bash-ov config switch <CONFIG-NAME> -o json+printf '%s' "$OV_API_KEY" | ov config add custom --name <NAME> --url <URL> --api-key-stdin --activate -o json```-然后运行验证命令。--### 添加 OpenViking Service--如果 Agent 已经通过可信渠道拿到 API Key,运行:+无鉴权的本机自建服务:```bash-ov config add ov-service --name <CONFIG-NAME> --api-key-stdin --activate -o json+ov config add custom --name <NAME> --url http://127.0.0.1:1933 --activate -o json```-shell pipe 形式如下:--```bash-printf '%s' "$API_KEY" | ov config add ov-service --name <CONFIG-NAME> --api-key-stdin --activate -o json-```+特殊密钥情况:-`$API_KEY` 表示可信的运行时密钥来源,不是字面量 key。Agent 能在不把 key 写进命令文本、shell history、日志或长期 export 的环境变量时提供 key,就应使用 stdin。--只把 API Key 内容写入 stdin,不要把 key 放进 shell 命令本身。这会写入一个 OpenViking Service 配置,并使用固定端点:`https://api.vikingdb.cn-beijing.volces.com/openviking`。`ov-service` 目标不接受自定义服务端 URL。--只有当环境变量已经存在时,才使用环境变量:--```bash-ov config add ov-service --name <CONFIG-NAME> --api-key-env <API-KEY-ENV-VAR> --activate -o json-```+- key 已经在环境变量中时,用 `--api-key-env <ENV_VAR>` 代替 `--api-key-stdin`。+- 只有 root key,且服务端为 `trusted` 模式:使用 `--root-api-key-stdin --account <ACCOUNT> --user <USER>`。服务端为 `api_key` 模式时,root key 不能读取数据,ASK 我提供 user 或 admin key。+- 同时有 user key 和 root key:使用 `--api-key-stdin --root-api-key-env <ENV_VAR>`。一条命令只有一个 stdin,所以第二个 key 必须来自已存在的环境变量。-标准 OpenViking Service 配置不要传 `--account` 或 `--user`。只有当用户或 OpenViking 管理员提供身份覆盖值时,才使用它们。+`ov config` 子命令的退出码:-### 添加本地自定义服务+| 退出码 | 含义 | 你的操作 |+|---|---|---|+| `0` | 成功,或已经处于目标状态 | 继续。 |+| `2` | 输入错误、缺少参数,或未设置显示语言 | 修正输入,或运行 `ov language <code>`。 |+| `3` | 同名配置已存在且内容不同 | 先 ASK 我,再加 `--force`。 |+| `4` | 服务端不可达,或配置校验失败 | ASK 我确认 URL,以及服务是否运行。 |+| `5` | 鉴权失败,或 key 角色不匹配 | ASK 我确认 key 和 key 类型。 |+| `6` | 操作被拒绝,例如删除当前配置 | ASK 我如何继续。 |-只有当用户选择本地自定义时,才使用这个路径。+不要用猜测的值重试。-对于本地无鉴权服务:+## 第 4 步:验证```bash-ov config add custom --name <CONFIG-NAME> --url http://127.0.0.1:1933 --activate -o json+ov config validate+ov health -o json```-如果本地服务没有运行,请先引导用户启动服务端。参见[部署指南](../guides/03-deployment.md)。+读取输出内容。退出码为 0 不代表服务健康。查看配置时使用 `ov config show`,它会隐藏密钥。不要打印 `~/.openviking/ovcli.conf`。-### 添加远程自定义服务+除非我要求,不要导入数据做演示。-对于使用普通 API Key 的远程自定义服务:+配置完成后,我可能会让你用 `ov` 浏览、检索、添加或整理内容。OpenViking 的内容是 `viking://` 下的目录树。读取时,先用 `ov abstract` 或 `ov overview` 读目录摘要,再用 `ov read` 读需要的文件。运行 `ov --help` 查看命令分组。使用某条命令前,先运行 `ov <命令> --help`。-```bash-ov config add custom --name <CONFIG-NAME> --url <REMOTE-OPENVIKING-URL> --api-key-stdin --activate -o json-```+EXECUTE NOW:完成上面的 TODO 列表,达到:`ov config validate` 的检查项全部通过,并且 `ov health -o json` 返回 `"healthy": true`。-stdin pipe 形式如下:+需要更多上下文时,阅读 https://docs.openviking.ai/llms.txt 。+````-```bash-printf '%s' "$API_KEY" | ov config add custom --name <CONFIG-NAME> --url <REMOTE-OPENVIKING-URL> --api-key-stdin --activate -o json-```+</AgentPrompt>-把 API Key 写入 stdin。如果 key 已经存在于当前 shell 环境变量中,可以改用 `--api-key-env <API-KEY-ENV-VAR>`。+下文是手动配置步骤。-对于 `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-```+需要 Node.js 和 npm。++还需要连接信息。连接信息取决于服务类型:-把 trusted 部署的 root API key 写入 stdin;account 和 user 用于指定 trusted 数据请求的调用者身份。+| 服务类型 | 服务地址 | API Key |+|---|---|---|+| OpenViking 服务(火山引擎云) | 固定地址,无需填写。 | 必填。在 [OpenViking 控制台](https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing)的**用户管理 → API Key** 中获取。 |+| 远程自建服务 | 向管理员获取。 | 向管理员获取。 |+| 本机自建服务 | `http://127.0.0.1:1933` | 默认配置不需要。 |-如果用户同时拥有 user key 和 root key,可以把两者放在同一个配置里:+## 1. 安装 `ov````bash-ov config add custom --name <CONFIG-NAME> --url <REMOTE-OPENVIKING-URL> --api-key-stdin --root-api-key-env <ROOT-API-KEY-ENV-VAR> --activate -o json+npm i -g @openviking/cli+ov language zh-CN+ov --version```-这样普通命令使用 user key,需要 `--sudo` 的命令使用 root key。因为一个命令只有一个 stdin 流,第二个 key 必须来自已经存在的环境变量。如果两个 key 都不在环境变量中,请使用 `ov config` 并引导用户完成交互式流程。+`ov language` 设置显示语言。英文界面使用 `en`。未设置语言时,大多数命令不能运行。-### 编辑或替换配置+在运行 OpenViking 服务端的机器上,`ov` 已随服务端安装。跳过 `npm i`,只设置语言。-先列出配置:+## 2. 添加连接```bash-ov config list -o json+ov config```-重命名并激活 saved config:+按提示操作:-```bash-ov config edit <CONFIG-NAME> --new-name <NEW-CONFIG-NAME> --activate -o json-```+1. 选择**添加配置**。+2. 选择服务类型。OpenViking 服务选择 **OpenViking 服务(火山引擎云)**;自建服务选择**自定义**。+3. 输入配置名称。留空时,`ov` 自动生成名称。+4. 按提示输入服务地址和 API Key。+5. 校验通过后,选择**保存并设为当前配置**。-替换 API Key:+## 3. 检查连接```bash-ov config edit <CONFIG-NAME> --api-key-stdin --activate -o json+ov config validate```-把新的 API Key 写入 stdin。+输出的**检查项**全部通过时,连接可用:配置文件“有效”,服务器“可连接”,认证“已通过”,健康状态“健康”。-替换自定义服务 URL:+配置到此完成。接下来可以[导入并检索第一份文档](02-quickstart.md#_3-导入文档)。想了解更多,可以继续往下看。-```bash-ov config edit <CONFIG-NAME> --url <CUSTOM-OPENVIKING-URL> --activate -o json-```+## `ov` 能做什么-只有在你明确要覆盖已有 saved config 名称时,才使用 `--force`。+OpenViking 的内容是一棵目录树。运行 `ov ls` 查看根目录 `viking://`:-### 删除 saved config+- `viking://resources/`:导入的文档、代码仓库和网页。同一账号内共享。+- `viking://user/<用户 ID>/`:你的记忆、私有资源、技能和会话。`viking://~/` 指向这个目录。+- `viking://agent/`:同一账号内共享的技能和 Agent 配置。-只删除非 active 的 saved config:+每个目录有 L0 摘要和 L1 概览。文件全文是 L2。先读目录的 L0 和 L1,判断内容是否相关,再读需要的 L2 文件。详见 [Viking URI](../concepts/04-viking-uri.md) 和[上下文层级](../concepts/03-context-layers.md)。-```bash-ov config delete <OLD-CONFIG-NAME> -o json-```+| 任务 | 命令 |+|---|---|+| 浏览目录 | `ov ls`、`ov tree`、`ov stat`。`ov tui` 打开交互式浏览界面。 |+| 按层读取 | `ov abstract`(L0)、`ov overview`(L1)、`ov read`(L2)。`ov get` 把文件下载到本地。 |+| 检索 | `ov find`(语义检索)、`ov grep`(匹配内容)、`ov glob`(匹配路径) |+| 导入资料和技能 | `ov add-resource`、`ov add-skill`、`ov skills` |+| 写入和整理 | `ov write`、`ov mkdir`、`ov mv`、`ov cp`、`ov rm` |+| 从对话中提取记忆 | `ov session new`、`ov session add-message`、`ov session commit`。`ov add-memory` 一步完成这三步。 |+| 等待后台处理 | `ov task list`、`ov task status`、`ov wait` |+| 保存和回滚版本 | `ov snapshot` |+| 备份与迁移 | `ov export`、`ov import`、`ov backup`、`ov restore` |+| 重建索引(`viking://resources` 需要 admin key) | `ov reindex` |+| 管理用户(需要 admin 或 root key) | `ov admin list-users`、`ov admin register-user`、`ov admin regenerate-key` |+| 检查服务 | `ov health`、`ov status` |-如果该配置正处于 active 状态,先切换到另一个配置:+导入资料和提交会话后,服务端在后台处理:解析内容,提取记忆,生成 L0 和 L1,建立索引。处理完成前,`ov find` 检索不到新内容。-```bash-ov config switch <CONFIG-NAME> -o json-ov config delete <OLD-CONFIG-NAME> -o json-```+用 `ov <命令> --help` 查看命令的参数。这些操作也可以直接交给 Agent 完成。-## 验证配置+::: warning 注意+`ov rm -r` 会删除目录及其中的全部内容。删除在服务端执行,使用同一服务的其他 Agent 也会失去这些内容。删除前,先用 `ov ls` 确认 URI。+:::-运行:+## 管理多个连接```bash-ov config show-ov config list -o json-ov config validate-ov health-ov status+ov config list # 列出已保存的配置+ov config switch # 选择当前配置+ov config show # 查看当前配置,密钥会被隐藏```-检查配置时优先使用 `ov config show`,因为它会隐藏密钥。--除非你理解配置文件可能包含密钥,否则不要打印原始配置文件。+编辑或删除配置时,运行 `ov config` 并选择对应操作。在脚本中添加配置时,使用 `ov config add`,参数见 `ov config add --help`。-如果验证命令提示 OpenViking 需要显示语言,请运行 `ov language en`;如果用户希望使用中文,则运行 `ov language zh-CN`,然后重新验证。+当前配置是 `~/.openviking/ovcli.conf`。每个已保存的配置是 `~/.openviking/ovcli.conf.<名称>`。设置 `OPENVIKING_CLI_CONFIG_FILE` 后,`ov` 改用该文件作为当前配置,已保存的配置位于该文件所在目录。全部字段见[客户端配置](../configuration/02-client.md)。-`ov status` 包含更宽泛的服务端和数据诊断。先确认 `ov config validate` 成功,并检查 `ov health` 返回的 `healthy` 值。当前 `ov health` 和表格模式的 `ov status` 可能在报告异常时仍以 0 退出,自动化应解析结果内容。`ov status` 中与连接无关的 warning 不一定代表 CLI 配置失败。+## API Key-## 学习其他 CLI 命令+服务使用 API Key 认证时,key 有三种角色:-配置成功后,用内置帮助继续了解 `ov` 的其他能力:--```bash-ov --help-ov config --help-ov add-resource --help-```+- **User key**:用于数据命令,例如 `ov add-resource` 和 `ov find`。大多数用户只需要这种 key。+- **Admin key**:可以执行数据命令,也可以管理本账号的用户。+- **Root key**:管理整个服务,例如创建账号。在 `api_key` 模式下,root key 不能读写账号数据。-运行不熟悉的命令前查看对应帮助,尤其是导入目标、异步等待和删除参数。+一个配置可以同时保存 user key 和 root key。普通命令使用 user key。`ov admin`、`ov system`、`ov reindex`、`ov task status` 和 `ov task list` 加 `--sudo` 时使用 root key。详见[认证](../guides/04-authentication.md)。-## 凭证安全+保护 API Key:-- API Key 可能允许访问你的 OpenViking 数据。-- 手动配置时,优先使用 `ov config` 的交互式输入框。-- Agent 辅助配置时,只有通过你明确相信的渠道提供 API Key。-- Agent 应通过 stdin 传入 key。只有当环境变量已经存在于当前 shell 中时,才使用环境变量。-- 不要把 API Key 直接写进可能被 shell history 保存的命令。-- 不要打印原始 `~/.openviking/ovcli.conf`。-- 不要分享包含 API Key 的截图。-- 演示和试用建议使用临时或可撤销的 key。+- 在 `ov config` 的输入框中输入 key。不要把 key 写进命令,shell 历史会保存命令。+- 用 `ov config show` 查看配置,它会隐藏密钥。不要分享 `~/.openviking/ovcli.conf` 的内容或截图。+- 演示和试用时,使用可以撤销的临时 key。+- 让 Agent 配置时,不要把 key 粘贴到对话中。把 key 放进环境变量,或在 Agent 请求时自己运行 `ov config` 输入 key。## 常见问题### 找不到 `ov`-运行:+打开一个新终端。仍然找不到时,把 npm 全局 binary 目录加入 `PATH`。在 macOS 和 Linux 上,该目录通常是 `$(npm prefix -g)/bin`。-```bash-npm i -g @openviking/cli-npm prefix -g-```+### npm 报权限错误-然后重新打开 shell,或把 npm 全局 binary 目录加入 `PATH`。在 macOS 和 Linux 上,该目录通常是 `$(npm prefix -g)/bin`。+按你平时管理 Node.js 的方式修复权限,例如使用 nvm。除非你一直用 sudo 管理全局包,否则不要运行 `sudo npm i -g`。-### npm 全局安装失败+### 命令提示需要显示语言-如果 npm 报权限错误,请按你平时管理 Node.js 的方式处理。除非你本来就用 sudo 管理全局 npm 包,否则不要直接运行 `sudo npm i -g`。+运行 `ov language zh-CN` 或 `ov language en`,然后重新运行命令。-### 本地服务端没有运行+### 本机服务没有响应-只有当用户选择本地自定义时才使用此项。先验证服务端:+检查服务:```bashcurl http://127.0.0.1:1933/health```-如果失败,先启动服务端再配置 `ov`。参见[部署指南](../guides/03-deployment.md)。+检查失败时,先启动服务端。参见[部署](../guides/03-deployment.md)。### API Key 校验失败-重新运行 `ov config` 并编辑配置。对于 OpenViking Service,确认 API Key 来自上面的 OpenViking 控制台地址。对于自定义服务,确认服务端是否要求鉴权。--Agent 不应该反复重试未知 key。请让用户确认目标类型、服务端 URL、key 类型、account 和 user。--### active 配置不对--检查并切换:--```bash-ov config show-ov config list-ov config switch-ov config validate-```--Agent 可以按名称切换:+运行 `ov config`,选择**编辑配置**,重新输入 key。OpenViking 服务的 key 从控制台复制。自建服务的 key 和 key 类型向管理员确认。在 `api_key` 模式下,数据命令需要 user key 或 admin key。-```bash-ov config list -o json-ov config switch <CONFIG-NAME> -o json-```+### 当前配置不对-### 非交互式配置不适合当前情况--使用交互式向导:--```bash-ov config-```--当密钥应由用户直接在终端输入、连接目标不明确,或校验结果需要人工判断时,这是合适的回退路径。--### 旧配置命令--使用 `ov config`。不要使用旧的或已移除的配置命令,例如 `ov config setup-cli`。+运行 `ov config list` 查看当前配置。运行 `ov config switch` 选择其他配置。## 下一步-CLI 配置完成后,使用 `ov --help` 和 `ov <command> --help` 继续了解其他命令。--添加资源会把数据写入 active OpenViking 服务端。如果你想做一个小演示,请选择你愿意存入服务端的资源。Agent 运行这类演示命令前,必须先征得用户同意。单纯验证连接无需写入资源。--```bash-ov add-resource https://github.com/volcengine/OpenViking-# 使用返回的 task_id 查询状态;completed 后再检索-ov task status TASK_ID-ov find "what is OpenViking"-ov tree viking://resources/ -L 2-```--查看全部命令:--```bash-ov --help-ov config --help-ov add-resource --help-```--## 重建索引--`ov reindex <uri>` 用于校验并修复已导入内容的索引,支持三种模式。resource 和 skill 默认按 MD5 增量跳过已经一致的记录:--- `--mode vectors_only` —— 只刷新向量。-- `--mode semantic_and_vectors` —— 先重新生成语义产物(`.abstract.md`、`.overview.md`),再刷新向量。--两种重建模式默认递归处理整个子树;添加 `--recursive=false` 后只处理目标本身。需要跳过 MD5 比较、强制重建作用域内全部 resource/skill 语义和向量数据时,添加 `--force`。--没有 `semantic` 或 `full` 这样的模式别名。+- 导入并检索第一份文档:[快速开始](02-quickstart.md)。+- 把 OpenViking 接入你日常使用的 Agent:[Agent 接入方式](../agent-integrations/01-overview.md)。diff --git a/docs/zh/guides/03-deployment.md b/docs/zh/guides/03-deployment.mdindex 37e3e2cca..3a91352bc 100644--- a/docs/zh/guides/03-deployment.md+++ b/docs/zh/guides/03-deployment.md@@ -398,8 +398,8 @@ docker compose up -d如需公网 HTTPS 访问,请参考 [公网访问指南](12-public-access.md)。-如需自行构建镜像,请显式传入 OpenViking 版本:-`docker build --build-arg OPENVIKING_VERSION=0.3.12 -t openviking:latest .`+如需自行构建镜像,请显式传入 OpenViking 版本。把 `<VERSION>` 替换为发布版本号:+`docker build --build-arg OPENVIKING_VERSION=<VERSION> -t openviking:latest .`### Kubernetes + Helmdiff --git a/docs/zh/guides/08-encryption.md b/docs/zh/guides/08-encryption.mdindex 44de897d9..674571b08 100644--- a/docs/zh/guides/08-encryption.md+++ b/docs/zh/guides/08-encryption.md@@ -96,36 +96,13 @@ test()| **文件层** | `encryption.enabled` | AES-GCM | 可逆 | 保护整个存储文件 || **API key 字段层** | `encryption.api_key_hashing.enabled` | Argon2id | 不可逆 | 保护 API key 本身 |-### 从隐式 API Key 哈希配置升级--适用于从 v0.3.12 及更早版本升级到 v0.3.13 及之后版本。--**行为变化**:-- **之前**:`encryption.enabled = true` 隐式启用 API key Argon2id 哈希-- **现在**:需要显式配置 `encryption.api_key_hashing.enabled`--**影响**:-- 升级后,如果 `encryption.enabled = true` 但 `encryption.api_key_hashing.enabled` 未显式配置为 `true`,会在启动时看到以下 INFO 日志片段:- ```- API key hashing is disabled while file encryption is enabled.- Previously, encryption.enabled=true implicitly enabled API key Argon2id hashing.- Now, API keys will be stored in plaintext within AES-GCM encrypted files.- To maintain the previous behavior, set encryption.api_key_hashing.enabled=true.- ```--**迁移选项**:--| 选项 | 配置 | 行为 |-|------|------|------|-| **保持原有行为** | `api_key_hashing.enabled = true` | API key 使用 Argon2id 哈希存储 |-| **可恢复的 key 存储(默认)** | `api_key_hashing.enabled = false`(默认) | API key 明文存储(文件层仍加密) |-### 默认行为**默认情况下,`encryption.api_key_hashing.enabled = false`**:- API key 以明文存储在 JSON 文件中- 如果 `encryption.enabled = true`,整个文件会被 AES-GCM 加密保护- `ov admin list-users` 可以显示完整的 API key+- 如果 `encryption.enabled = true` 且未启用 API key 哈希,服务端启动时会输出一条说明此情况的 INFO 日志### 启用 Argon2id 哈希