adding-resource

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenViking (OV)
add-resource

OpenViking (OV)
add-resource

The
ov add-resource
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
viking://resources/
namespace.
ov add-resource
命令可将外部资源导入到OpenViking的上下文数据库中——支持本地文件、目录、URL和远程仓库。资源会自动经过语义分析处理,并被整理到
viking://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
undefined

Import 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
undefined
ov add-resource ./project-source
undefined

Context and Instructions

上下文与指令

Add metadata to guide processing:
bash
undefined
添加元数据以指导处理过程:
bash
undefined

Provide 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"
undefined
ov add-resource https://example.com/guide --reason "User guide" --instruction "Extract best practices and examples"
undefined

Async Processing Control

异步处理控制

Wait for semantic processing to complete:
bash
undefined
等待语义处理完成:
bash
undefined

Wait 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
undefined
ov add-resource ./docs
undefined

Output

输出结果

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时需具备网络访问权限
  • 对本地文件/目录拥有读取权限