openviking

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenViking Code Repository Search

OpenViking 代码仓库搜索

IMPORTANT: All
ov
commands are terminal (shell) commands — run them via the
bash
tool. Execute directly — no pre-checks, no test commands. Handle errors when they occur.
重要提示:所有
ov
命令都是终端(Shell)命令——请通过
bash
工具运行。直接执行——无需预检查,无需测试命令。出现错误时再进行处理。

How OpenViking Organizes Data

OpenViking 如何组织数据

OpenViking stores content in a virtual filesystem under the
viking://
namespace, similar to a local directory tree:
viking://
└── resources/
    ├── fastapi/               ← repo A
    │   ├── fastapi/
    │   │   ├── routing.py
    │   │   └── dependencies/
    │   └── tests/
    └── requests/              ← repo B
        ├── requests/
        └── tests/
Each directory has AI-generated summaries (
abstract
/
overview
). 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.
OpenViking 将内容存储在
viking://
命名空间下的虚拟文件系统中,类似于本地目录树:
viking://
└── resources/
    ├── fastapi/               ← repo A
    │   ├── fastapi/
    │   │   ├── routing.py
    │   │   └── dependencies/
    │   └── tests/
    └── requests/              ← repo B
        ├── requests/
        └── tests/
每个目录都有AI生成的摘要(
abstract
/
overview
)。核心原则:缩小URI范围以提升检索效率。 不要搜索所有仓库,锁定到特定仓库或子目录——这能显著减少干扰并加快结果返回速度。

Search Commands

搜索命令

Choose the right command based on what you're looking for:
CommandUse whenExample
ov find
You know the concept but not the exact code"dependency injection", "rate limiting logic"
ov grep
You know the exact keyword or symbolfunction name, class name, error string
ov glob
You want to enumerate files by patternall
*.py
files, all test files
bash
undefined
根据你的需求选择合适的命令:
命令使用场景示例
ov find
你知道概念但不知道具体代码"依赖注入", "限流逻辑"
ov grep
你知道确切的关键词或符号函数名、类名、错误字符串
ov glob
你想按模式枚举文件所有
*.py
文件、所有测试文件
bash
undefined

Semantic 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
undefined
bash
undefined

Directories: 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 tree
bash
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
--timeout
is required (seconds). Use 300 (5 min) for small repos, increase for larger ones.
After submitting, run
ov observer queue
once and report status to user. Indexing runs in background — do not poll or wait.
Repo SizeFilesEst. Time
Small< 1002–5 min
Medium100–5005–20 min
Large500+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
为必填项(单位:秒)。小型仓库使用300(5分钟),大型仓库可适当增加时长。
提交后,运行一次
ov observer queue
并向用户报告状态。索引在后台运行——无需轮询或等待。
仓库规模文件数量预估时间
小型< 1002–5分钟
中型100–5005–20分钟
大型500+20–60+分钟

Remove a Repository

删除仓库

bash
ov rm viking://resources/fastapi --recursive
This 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: ov
→ Tell user:
pip install openviking --upgrade --force-reinstall
. Stop.
url is required
/
CLI_CONFIG
error
→ Auto-create config and retry:
bash
mkdir -p ~/.openviking && echo '{"url": "http://localhost:1933"}' > ~/.openviking/ovcli.conf
CONNECTION_ERROR
/ failed to connect:
  • ~/.openviking/ov.conf
    exists → auto-start server, wait until healthy, retry:
    bash
    openviking-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
    ~/.openviking/ov.conf
    first. Stop.
command not found: ov
→ 告知用户:
pip install openviking --upgrade --force-reinstall
。停止操作。
url is required
/
CLI_CONFIG
错误
→ 自动创建配置并重试:
bash
mkdir -p ~/.openviking && echo '{"url": "http://localhost:1933"}' > ~/.openviking/ovcli.conf
CONNECTION_ERROR
/ 连接失败:
  • ~/.openviking/ov.conf
    存在 → 自动启动服务器,等待健康状态后重试:
    bash
    openviking-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