openviking
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOpenViking Code Repository Search
OpenViking 代码仓库搜索
IMPORTANT: All commands are terminal (shell) commands — run them via the tool. Execute directly — no pre-checks, no test commands. Handle errors when they occur.
ovbash重要提示:所有命令都是终端(Shell)命令——请通过工具运行。直接执行——无需预检查,无需测试命令。出现错误时再进行处理。
ovbashHow OpenViking Organizes Data
OpenViking 如何组织数据
OpenViking stores content in a virtual filesystem under the namespace, similar to a local directory tree:
viking://viking://
└── resources/
├── fastapi/ ← repo A
│ ├── fastapi/
│ │ ├── routing.py
│ │ └── dependencies/
│ └── tests/
└── requests/ ← repo B
├── requests/
└── tests/Each directory has AI-generated summaries ( / ). The key principle: narrow the URI scope to improve retrieval efficiency. Instead of searching all repos, lock to a specific repo or subdirectory — this reduces noise and speeds up results significantly.
abstractoverviewOpenViking 将内容存储在命名空间下的虚拟文件系统中,类似于本地目录树:
viking://viking://
└── resources/
├── fastapi/ ← repo A
│ ├── fastapi/
│ │ ├── routing.py
│ │ └── dependencies/
│ └── tests/
└── requests/ ← repo B
├── requests/
└── tests/每个目录都有AI生成的摘要( / )。核心原则:缩小URI范围以提升检索效率。 不要搜索所有仓库,锁定到特定仓库或子目录——这能显著减少干扰并加快结果返回速度。
abstractoverviewSearch Commands
搜索命令
Choose the right command based on what you're looking for:
| Command | Use when | Example |
|---|---|---|
| You know the concept but not the exact code | "dependency injection", "rate limiting logic" |
| You know the exact keyword or symbol | function name, class name, error string |
| You want to enumerate files by pattern | all |
bash
undefined根据你的需求选择合适的命令:
| 命令 | 使用场景 | 示例 |
|---|---|---|
| 你知道概念但不知道具体代码 | "依赖注入", "限流逻辑" |
| 你知道确切的关键词或符号 | 函数名、类名、错误字符串 |
| 你想按模式枚举文件 | 所有 |
bash
undefinedSemantic search — concept/intent based
语义搜索——基于概念/意图
ov find "dependency injection" --uri viking://resources/fastapi --limit 10
ov find "how tokens are refreshed" --uri viking://resources/fastapi/fastapi/security
ov find "JWT authentication" --limit 10 # across all repos
ov find "dependency injection" --uri viking://resources/fastapi --limit 10
ov find "how tokens are refreshed" --uri viking://resources/fastapi/fastapi/security
ov find "JWT authentication" --limit 10 # 跨所有仓库
Keyword search — exact match or regex
关键词搜索——精确匹配或正则
ov grep "verify_token" --uri viking://resources/fastapi
ov grep "class.*Session" --uri viking://resources/requests/requests
ov grep "verify_token" --uri viking://resources/fastapi
ov grep "class.*Session" --uri viking://resources/requests/requests
File enumeration — by name pattern (--uri is required)
文件枚举——按名称模式(--uri为必填项)
ov glob "/*.py" --uri viking://resources/fastapi
ov glob "/test_.py" --uri viking://resources/fastapi/tests
ov glob "**/.py" --uri viking://resources/ # across all repos
**Narrowing scope:** once you identify a relevant directory, pass it as `--uri` to restrict subsequent searches to that subtree — this is faster and more precise than searching the whole repo.ov glob "/*.py" --uri viking://resources/fastapi
ov glob "/test_.py" --uri viking://resources/fastapi/tests
ov glob "**/.py" --uri viking://resources/ # 跨所有仓库
**缩小范围:** 一旦找到相关目录,将其作为`--uri`传入,以限制后续搜索到该子目录——这比搜索整个仓库更快、更精准。Read Content
读取内容
bash
undefinedbash
undefinedDirectories: AI-generated summaries
目录:AI生成的摘要
ov abstract viking://resources/fastapi/fastapi/dependencies/ # one-line summary
ov overview viking://resources/fastapi/fastapi/dependencies/ # detailed breakdown
ov abstract viking://resources/fastapi/fastapi/dependencies/ # 单行摘要
ov overview viking://resources/fastapi/fastapi/dependencies/ # 详细分解
Files: raw content
文件:原始内容
ov read viking://resources/fastapi/fastapi/dependencies/utils.py
ov read viking://resources/fastapi/fastapi/dependencies/utils.py --offset 100 --limit 50
`abstract` / `overview` only work on directories. `read` only works on files.ov read viking://resources/fastapi/fastapi/dependencies/utils.py
ov read viking://resources/fastapi/fastapi/dependencies/utils.py --offset 100 --limit 50
`abstract`/`overview`仅适用于目录。`read`仅适用于文件。Browse
浏览
bash
ov ls viking://resources/ # list all indexed repos
ov ls viking://resources/fastapi # list repo top-level contents
ov tree viking://resources/fastapi # full directory treebash
ov ls viking://resources/ # 列出所有已索引的仓库
ov ls viking://resources/fastapi # 列出仓库顶层内容
ov tree viking://resources/fastapi # 完整目录树Add a Repository
添加仓库
bash
ov add-resource https://github.com/owner/repo --to viking://resources/ --timeout 300
ov add-resource /path/to/project --to viking://resources/ --timeout 300--timeoutAfter submitting, run once and report status to user. Indexing runs in background — do not poll or wait.
ov observer queue| Repo Size | Files | Est. Time |
|---|---|---|
| Small | < 100 | 2–5 min |
| Medium | 100–500 | 5–20 min |
| Large | 500+ | 20–60+ min |
bash
ov add-resource https://github.com/owner/repo --to viking://resources/ --timeout 300
ov add-resource /path/to/project --to viking://resources/ --timeout 300--timeout提交后,运行一次并向用户报告状态。索引在后台运行——无需轮询或等待。
ov observer queue| 仓库规模 | 文件数量 | 预估时间 |
|---|---|---|
| 小型 | < 100 | 2–5分钟 |
| 中型 | 100–500 | 5–20分钟 |
| 大型 | 500+ | 20–60+分钟 |
Remove a Repository
删除仓库
bash
ov rm viking://resources/fastapi --recursiveThis permanently deletes the repo and all its indexed content. Confirm with the user before running.
bash
ov rm viking://resources/fastapi --recursive此操作会永久删除该仓库及其所有索引内容。运行前请与用户确认。
Error Handling
错误处理
command not found: ovpip install openviking --upgrade --force-reinstallurl is requiredCLI_CONFIGbash
mkdir -p ~/.openviking && echo '{"url": "http://localhost:1933"}' > ~/.openviking/ovcli.confCONNECTION_ERROR- exists → auto-start server, wait until healthy, retry:
~/.openviking/ov.confbashopenviking-server --config ~/.openviking/ov.conf > /tmp/openviking.log 2>&1 & for i in $(seq 1 10); do ov health 2>/dev/null && break; sleep 3; done - Does not exist → Tell user to configure first. Stop.
~/.openviking/ov.conf
command not found: ovpip install openviking --upgrade --force-reinstallurl is requiredCLI_CONFIGbash
mkdir -p ~/.openviking && echo '{"url": "http://localhost:1933"}' > ~/.openviking/ovcli.confCONNECTION_ERROR- 若存在 → 自动启动服务器,等待健康状态后重试:
~/.openviking/ov.confbashopenviking-server --config ~/.openviking/ov.conf > /tmp/openviking.log 2>&1 & for i in $(seq 1 10); do ov health 2>/dev/null && break; sleep 3; done - 若不存在 → 告知用户先配置。停止操作。
~/.openviking/ov.conf
More Help
更多帮助
For other issues or command details, run:
bash
ov help
ov <command> --help # e.g. ov find --help遇到其他问题或需要命令详情时,运行:
bash
ov help
ov <command> --help # 例如 ov find --help