adding-resource
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOpenViking (OV) add-resource
add-resourceOpenViking (OV) add-resource
add-resourceThe command imports external resources into OpenViking's context database — supporting local files, directories, URLs, and remote repositories. Resources are automatically processed with semantic analysis and organized under the namespace.
ov add-resourceviking://resources/ov add-resourceviking://resources/When to Use
使用场景
- Importing project documentation, code repositories, or reference materials
- Adding web pages, articles, or online resources for future retrieval
- Building a knowledge base from external sources
- When an agent encounters valuable content that should persist across sessions
- 导入项目文档、代码仓库或参考资料
- 添加网页、文章或在线资源以便后续检索
- 从外部来源构建知识库
- 当Agent遇到需要跨会话持久化的有价值内容时
Input Options
输入选项
Basic Usage
基础用法
Import a local file or URL:
bash
undefined导入本地文件或URL:
bash
undefinedImport from URL
从URL导入
Import local file
导入本地文件
ov add-resource ./docs/api-spec.md
ov add-resource ./docs/api-spec.md
Import local directory
导入本地目录
ov add-resource ./project-source
undefinedov add-resource ./project-source
undefinedContext and Instructions
上下文与指令
Add metadata to guide processing:
bash
undefined添加元数据以指导处理过程:
bash
undefinedProvide reason for import
提供导入原因
ov add-resource ./api-docs.md --reason "REST API documentation for v2 endpoints"
ov add-resource ./api-docs.md --reason "REST API documentation for v2 endpoints"
Add processing instructions
添加处理指令
ov add-resource ./large-repo --instruction "Focus on authentication and authorization patterns"
ov add-resource ./large-repo --instruction "Focus on authentication and authorization patterns"
Combine reason and instruction
同时提供原因和指令
ov add-resource https://example.com/guide --reason "User guide" --instruction "Extract best practices and examples"
undefinedov add-resource https://example.com/guide --reason "User guide" --instruction "Extract best practices and examples"
undefinedAsync Processing Control
异步处理控制
Wait for semantic processing to complete:
bash
undefined等待语义处理完成:
bash
undefinedWait until processing finishes
等待处理完成
ov add-resource ./docs --wait
ov add-resource ./docs --wait
Wait with timeout (in seconds)
设置超时等待(单位:秒)
ov add-resource https://example.com/docs --wait --timeout 60
ov add-resource https://example.com/docs --wait --timeout 60
Fire and forget (default)
触发后即返回(默认模式)
ov add-resource ./docs
undefinedov add-resource ./docs
undefinedOutput
输出结果
Returns the root URI of the imported resource:
root_uri viking://resources/...返回导入资源的根URI:
root_uri viking://resources/...Prerequisites
前置条件
- CLI configured:
~/.openviking/ovcli.conf - Network access for URL imports
- Read permissions for local files/directories
- CLI已配置:
~/.openviking/ovcli.conf - 导入URL时需具备网络访问权限
- 对本地文件/目录拥有读取权限