Clawshow Gateway Connect
Execute a safe, minimal install-and-migrate flow from current OpenClaw settings to ClawShowGateway without breaking unrelated configuration.
Runtime Inputs
- - Required: INLINECODE0
- Optional:
relayUrl (default wss://clawshow-api.bowong.cc) - If
authToken is missing, ask once and stop before editing.
Workflow
- 1. Install ws dependency
- - Run
npm i ws in the project root before proceeding. - Confirm installation succeeds before continuing.
- 2. Identify current config source
- - Search only OpenClaw gateway config files (
*.json, *.yaml, *.yml) in the active project path. - Do not read
.env, secrets files, deployment manifests, or unrelated workspace files. - Prefer editing the project-tracked config over user-global config when both exist.
- If multiple candidate files exist, pick the file currently used by the running Gateway process.
- 3. Create rollback copy before edits
- - Save a sibling backup copy of the target config file with timestamp suffix (for example
.bak.20260313-1405). - Never delete the backup in the same task.
- 4. Check OpenClaw version gate (before plugin install)
- - Query current OpenClaw version using the supported command only:
-
openclaw version
- - Compare against
2026.3.2 using OpenClaw's version ordering. - If current version is earlier than
2026.3.2, upgrade OpenClaw using openclaw update first, then re-run:
-
openclaw version
- - Continue only after version check/upgrade is complete.
- 5. Install plugin/package
- - Install using OpenClaw plugin manager only:
-
openclaw plugins install @bowong/clawshow-gateway
-
openclaw plugins list
- - Confirm package id is exactly
@bowong/clawshow-gateway. - If already installed, do not reinstall unless version repair is needed.
- 6. Migrate channel config to ClawShow
- - Ensure package id references
@bowong/clawshow-gateway where plugin/package declarations are required. - Ensure channel section exists under
channels.clawshow. - Set:
-
channels.clawshow.enabled: true (required)
-
channels.clawshow.relayUrl: "wss://clawshow-api.bowong.cc" (optional)
-
channels.clawshow.authToken: "<real token>" (required)
-
channels.clawshow.name: "ClawShow Gateway" (required)
-
channels.clawshow.dmPolicy: "open" (required)
-
channels.clawshow.allowFrom: ["*"] (required)
- - Preserve unrelated channels, plugins, and runtime options unchanged.
- 7. Remove conflicting legacy routing only when necessary
- - If older channel config routes the same outbound traffic target, disable only the overlapping route.
- Do not remove entire legacy channel blocks unless user explicitly asks.
- 8. Validate config shape
- - Confirm JSON/YAML syntax after edit.
- Confirm required keys exist for ClawShow (
authToken at minimum). - Confirm package/plugin id and channel id are consistent (
clawshow). - Confirm
enabled, relayUrl, authToken, name, dmPolicy, and allowFrom are directly under channels.clawshow (no default layer).
- 9. Apply config (Config RPC only)
- - Follow
Config RPC (programmatic updates) exactly, using config.apply (full replace). - Do not use direct file-edit-only activation,
config.patch, or manual restart as the primary path. - Execute:
-
openclaw gateway call config.get --params '{}'
- Capture
payload.hash as
baseHash.
- Build the full post-migration config as one JSON5 string in
raw.
-
openclaw gateway call config.apply --params '{ "raw": "<full-json5-config>", "baseHash": "<hash>", "note": "migrate to @bowong/clawshow-gateway" }'
- - Respect control-plane rate limits for write RPCs (
config.apply, config.patch, update.run): 3 requests per 60 seconds per deviceId+clientIp. - If apply fails due to stale hash/conflict, call
config.get again, rebase on newest config, and retry once.
- 10. Verify runtime behavior
- - Do not force a manual restart here;
config.apply already validates, writes, and restarts in one step. - Run status/probe command if available.
- Do not send outbound test messages by default.
- Only send an external test message if the user explicitly asks for network verification.
- 11. Report outcome
- - Include the backup file path.
- Include verification command results.
- If verification is blocked, state the blocker and provide the exact next command.
Canonical Target Snippet
Use this structure when writing or repairing JSON config:
CODEBLOCK0
Guardrails
- - Keep edits minimal and reversible.
- Never invent secrets; leave placeholders for missing keys.
- Never exfiltrate secrets from local files.
- Never rewrite formatting style of the whole file.
- Never remove unrelated keys to "clean up".
技能名称: clawshow-gateway-connect
ClawShow 网关连接
执行一个安全、最小化的安装与迁移流程,将当前 OpenClaw 设置迁移至 ClawShowGateway,且不破坏无关配置。
运行时输入
- - 必需:authToken
- 可选:relayUrl(默认值 wss://clawshow-api.bowong.cc)
- 如果缺少 authToken,询问一次后停止,不进行编辑。
工作流程
- 1. 安装 ws 依赖
- 在项目根目录运行 npm i ws 后再继续。
- 确认安装成功后再继续。
- 2. 识别当前配置来源
- 仅在当前项目路径中搜索 OpenClaw 网关配置文件(
.json、.yaml、*.yml)。
- 不读取 .env、密钥文件、部署清单或无关的工作区文件。
- 当项目跟踪的配置和用户全局配置同时存在时,优先编辑项目跟踪的配置。
- 如果存在多个候选文件,选择当前正在运行的网关进程所使用的文件。
- 3. 编辑前创建回滚副本
- 保存目标配置文件的同级备份副本,并添加时间戳后缀(例如 .bak.20260313-1405)。
- 在同一任务中绝不删除该备份。
- 4. 检查 OpenClaw 版本门控(在安装插件前)
- 仅使用支持的命令查询当前 OpenClaw 版本:
- openclaw version
- 使用 OpenClaw 的版本排序规则与 2026.3.2 进行比较。
- 如果当前版本早于 2026.3.2,先使用 openclaw update 升级 OpenClaw,然后重新运行:
- openclaw version
- 仅在版本检查/升级完成后继续。
- 5. 安装插件/包
- 仅使用 OpenClaw 插件管理器安装:
- openclaw plugins install @bowong/clawshow-gateway
- 验证安装:
- openclaw plugins list
- 确认包 ID 确为 @bowong/clawshow-gateway。
- 如果已安装,除非需要版本修复,否则不重新安装。
- 6. 将频道配置迁移至 ClawShow
- 在需要声明插件/包的地方,确保包 ID 引用 @bowong/clawshow-gateway。
- 确保 channels.clawshow 下存在频道部分。
- 设置:
- channels.clawshow.enabled: true(必需)
- channels.clawshow.relayUrl: wss://clawshow-api.bowong.cc(可选)
- channels.clawshow.authToken: <真实令牌>(必需)
- channels.clawshow.name: ClawShow Gateway(必需)
- channels.clawshow.dmPolicy: open(必需)
- channels.clawshow.allowFrom: [*](必需)
- 保持无关频道、插件和运行时选项不变。
- 7. 仅在必要时移除冲突的旧版路由
- 如果旧频道配置路由到相同的出站流量目标,仅禁用重叠的路由。
- 除非用户明确要求,否则不删除整个旧频道块。
- 8. 验证配置结构
- 编辑后确认 JSON/YAML 语法正确。
- 确认 ClawShow 所需的键存在(至少 authToken)。
- 确认包/插件 ID 和频道 ID 一致(均为 clawshow)。
- 确认 enabled、relayUrl、authToken、name、dmPolicy 和 allowFrom 直接位于 channels.clawshow 下(无 default 层级)。
- 9. 应用配置(仅限配置 RPC)
- 严格按照 配置 RPC(程序化更新) 执行,使用 config.apply(完全替换)。
- 不将直接文件编辑激活、config.patch 或手动重启作为主要路径。
- 执行:
- openclaw gateway call config.get --params {}
- 捕获 payload.hash 作为 baseHash。
- 将完整的迁移后配置构建为一个 JSON5 字符串,放入 raw。
- openclaw gateway call config.apply --params { raw: <完整-json5-配置>, baseHash: <哈希值>, note: 迁移至 @bowong/clawshow-gateway }
- 遵守控制平面写入 RPC(config.apply、config.patch、update.run)的速率限制:每 60 秒每个 deviceId+clientIp 最多 3 次请求。
- 如果因哈希过期/冲突导致应用失败,重新调用 config.get,基于最新配置重新构建,并重试一次。
- 10. 验证运行时行为
- 此处不强制手动重启;config.apply 已一步完成验证、写入和重启。
- 如果可用,运行状态/探测命令。
- 默认不发送出站测试消息。
- 仅当用户明确要求网络验证时,才发送外部测试消息。
- 11. 报告结果
- 包含备份文件路径。
- 包含验证命令结果。
- 如果验证受阻,说明阻碍原因并提供确切的下一步命令。
规范目标代码片段
编写或修复 JSON 配置时使用此结构:
json
{
channels: {
clawshow: {
enabled: true,
relayUrl: wss://clawshow-api.bowong.cc,
authToken: YOURCLAWSHOWAUTH_TOKEN,
name: ClawShow Gateway,
dmPolicy: open,
allowFrom: [
*
]
}
}
}
防护措施
- - 保持编辑最小化且可逆。
- 绝不编造密钥;为缺失的键保留占位符。
- 绝不从本地文件中窃取密钥。
- 绝不重写整个文件的格式风格。
- 绝不删除无关键以进行清理。