文档导航

RELAYBUNDLES / DOCS

CLI 与 Skill 参考

查阅命令、profile 配置、版本检查与恢复步骤。

更新于

以下示例假定 CLI 已登录并选定工作区。请替换占位符。使用独立 profile 时,每条命令都要带上自己的 --profile。

安装与命令帮助

使用配套的 CLI 安装包与 Skill。完整选项请查阅本机帮助和公开 CLI 源码。

relay --version
relay --help
relay context --help
relay ws memory --help
relay bundle --help

供模型读取的说明见 agent-install.md 与 Skill 发现入口。

身份与独立 profile

Device 是逻辑客户端身份。同一台机器上的两个 Agent 可以共用账号,分别使用不同 profile 和设备名。

配置 Agent A:

relay --profile agent-a config set url https://relaybundles.com
relay --profile agent-a login --identifier "<账号>" --device "PC-Agent-A"
relay --profile agent-a ws use "<工作区ID>"
relay --profile agent-a whoami --json

再用 agent-b profile 和 PC-Agent-B 设备名重复配置。每个 profile 都需要独立的服务地址、会话和工作区选择。后续每条调用继续带上各自的 profile:

relay --profile agent-a context list --json
relay --profile agent-b ws memory show --json

只在同一 profile 中更改 login --device,会复用原有设备绑定。独立 profile 隔离本机配置,工作区权限和额度仍由账号决定。

添加与读取 Context

relay context add ./discussion.md --json
relay context list --json
relay context list --cursor <nextCursor> --json
relay context read <context-id> --json
relay context download <context-id> --output ./received.md --json

list 和 read 默认返回完整原文与当前 Memory。列表默认每页 20 份资料,需要时用返回的 nextCursor 继续读取。

只需要索引时,运行 relay context list --metadata-only --json,再读取选中的原文。

粘贴文本可通过管道将实际 UTF-8 内容传给 relay context add --stdin --name discussion.md --json。这个命令本身不会读取剪贴板。

安全写入 Memory

relay ws memory show --json
relay ws memory set --file ./workspace-memory.md --expected-version <编辑前读取的版本> --json

在两条命令之间,将完整 UTF-8 正文写入 workspace-memory.md,保留有效指引并合并改动。服务器会替换正文,不会自动追加。

遇到 WORKSPACE_MEMORY_CONFLICT 时,重新读取当前正文,再次合并后用对应版本提交。不要给旧正文换上新版本号直接重试。该命令没有强制覆盖选项。

新工作区的空 Memory 从版本 0 开始。较晚版本如果被清空,不应未经授权用旧资料重建。

在网页打开 Memory → Versions,可以查看、比较或恢复正文。恢复会创建新版本。首版没有 CLI Memory 历史命令。

发布与接收 Bundle

relay bundle push ./output --note "报告与配套图表。" --json
relay bundle list --json
relay bundle show <bundle-id> --json
relay bundle pull <bundle-id> --output ./incoming --save-note --json
relay history --limit 20 --json

继续任务前,先阅读完整 Note。--save-note 将正文保存为 RELAY_NOTE.md,普通 pull 不生成这个文件。Pull 不会覆盖已有文件。

自己的产物或已读交付请用 list/show。inbox 只包含其他 Device 发出的未读 READY Bundle。

恢复中断传输

保持服务、账号/profile、工作区、源文件、Note、输出目录和 CLI 恢复状态不变。按错误提示重新运行原命令。

如果提示只剩最终发布,请按提示操作,或运行:

relay bundle finalize <bundle-id>

恢复前不要删除临时下载文件。核对接收文件之前,请保留源文件。恢复仍受服务器清理期限约束。

存储与回收站

relay storage stats
relay context delete <context-id> --json
relay context list --trash --json
relay context restore <context-id> --json

Context 会留在回收站,直到所有者永久清理。Bundle 默认保留 30 天。回收站内容仍占存储,移入回收站不会立即释放容量。

共享工作区的上传使用所有者额度。永久删除无法撤销,首次验证无需清空资料。