Community生产力与协作github.com

steipete/openclaw-relay

OpenClaw 会话中继:通过本地或远程 SSH 的 acpx 发送提示和帖子。

openclaw-relay 是什么?

这是一个用于 Claude Code、Cursor 和 Codex 等 AI 代理的技能,充当 OpenClaw 会话的中继器。它允许开发者通过两种传输方式向 OpenClaw 频道会话发送提示和帖子:`local`(直接从当前机器工作)或 `ssh`(连接到远程主机)。该工具使用 `scripts/openclaw_relay.py` 脚本,并配合 `config/session_aliases.json` 中的目标别名,从而简化与特定代理或频道的交互。其主要优势在于能够实现异步工作流(排队、等待和检查结果)以及管理持久控制会话。这使其适用于快速私人询问、跨多机器会话的持久桥接路由,以及从单一命令行界面强制发送消息或媒体。该技能提供了对配置(如传输类型、主机名和会话名称)的全面控制,并可通过环境变量覆盖,同时内置了健康检查和故障处理命令。

兼容平台~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/steipete/agent-scripts/tree/main/skills/openclaw-relay

Installed? Explore more 生产力与协作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

OpenClaw 中继

在以下任务中使用此技能:

  • "与 Molty 对话"
  • "将此内容中继到 OpenClaw 频道会话中"
  • "使用 acpx"
  • "通过 acp 网关发送"
  • "通过 SSH 远程 OpenClaw 桥接器工作"

一个技能,两种传输方式:

  1. local(本地)
  2. ssh

默认使用 local,用于从当前 OpenClaw 检出版本直接进行传话式工作。当目标代理/会话位于另一台机器上时,使用 ssh。

对于 Peter 的设置,Molty 通常位于 Mac Studio 网关上,可通过 [email protected] 访问;避免使用 mac-studio SSH 别名进行一次性中继工作,因为该别名会自动附加 tmux。

脚本路径:scripts/openclaw_relay.py

目标别名文件:config/session_aliases.json

模式选择

当以下情况时选择 local:

  • 用户明确指定 acpx
  • 目标会话位于当前机器上
  • 目标是快速中继或私人询问

当以下情况时选择 ssh:

  • 目标代理/会话位于另一台主机上
  • 你想要一个持久的桥接会话
  • 你需要在远程机器上异步执行队列/等待/显示流程

默认值

该脚本避免硬编码个人路径。必要时可通过环境变量或标志覆盖。

  • 传输方式:local
  • 本地仓库当前工作目录:当前工作目录
  • 本地 acpx 仓库:<cwd>/extensions/acpx
  • SSH 主机:[email protected]
  • 远程仓库当前工作目录:<remote-home>/clawdbot
  • 远程 acpx 仓库:<remote-home>/Projects/oss/acpx
  • 网关令牌文件:<home>/.openclaw/gateway.token
  • 控制会话名称:codex-bridge
  • 目标别名文件:config/session_aliases.json

有用的环境变量:

  • OPENCLAW_RELAY_TRANSPORT
  • OPENCLAW_RELAY_HOST
  • OPENCLAW_RELAY_CWD
  • OPENCLAW_RELAY_ACPX_REPO
  • OPENCLAW_RELAY_GATEWAY_URL
  • OPENCLAW_RELAY_GATEWAY_TOKEN_FILE
  • OPENCLAW_RELAY_SESSION
  • OPENCLAW_RELAY_TARGETS_FILE

快速开始

健康检查:

python3 scripts/openclaw_relay.py doctor

列出已知目标别名:

python3 scripts/openclaw_relay.py targets

解析目标别名:

python3 scripts/openclaw_relay.py resolve --target maintainers

向目标会话私下提问:

python3 scripts/openclaw_relay.py ask \
  --target maintainers \
  --message "总结一下该频道当前的氛围。"

强制将文本发送到已解析的目标:

python3 scripts/openclaw_relay.py force-send \
  --target maintainers \
  --text "部署已完成。"

对于多行帖子,使用 --text-file <path> 或 --text-file - 而不是对消息进行 shell 转义。

当用户明确要求频道帖子时强制发送媒体:

python3 scripts/openclaw_relay.py force-send \
  --transport ssh \
  --host [email protected] \
  --target maintainers \
  --text "演示视频。" \
  --media /tmp/demo.mp4

使用持久控制会话:

python3 scripts/openclaw_relay.py ensure
python3 scripts/openclaw_relay.py send --message "请回复完全相同的 OK。"
python3 scripts/openclaw_relay.py show

远程主机示例:

python3 scripts/openclaw_relay.py doctor --transport ssh --host [email protected]
python3 scripts/openclaw_relay.py send \
  --transport ssh \
  --host [email protected] \
  --message "请回复完全相同的 OK。"

异步工作流

将工作排入队列并在同一个控制会话中轮询:

python3 scripts/openclaw_relay.py start --message "处理任务 X,完成后回复。"
python3 scripts/openclaw_relay.py wait --after-seq <last-seq>
python3 scripts/openclaw_relay.py show

目标别名

config/session_aliases.json 附带了占位符。请将其替换为你的实际设置值。

示例结构:

{
  "main": "agent:<agentId>:main",
  "maintainers": "agent:<agentId>:discord:channel:<channelId>"
}

会话规则

在选择命令时使用以下规则:

  • 想要特定会话的私人回复:使用 ask
  • 想要目标会话自行决定是否发布:使用 publish
  • 想要保证直接发布:使用 force-send
  • 想要与控制大脑进行阻塞式连续交互:使用 send
  • 想要即发即忘的异步操作:使用 start,然后 wait 和 show
  • 想要停止已排入队列的工作:使用 cancel

失败处理

如果中继工作失败:

  1. 运行 doctor。
  2. 运行 status。
  3. 运行 show。
  4. 如果控制会话卡住,运行 cancel,然后 ensure,再重试。

如果路由发现不确定:

  1. 首先解析目标。
  2. 优先使用别名或确切的会话键。
  3. 在发送实际负载之前,使用一个小的探测性询问。

输出中继

返回实际的助手文本或投递结果,而不是 shell 噪音。

对于中继任务,报告:

  • 使用的传输方式
  • 目标会话键
  • 路由探测/解析是否成功
  • 最终发布或返回的结果

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

steipete/agent-transcript

GitHub PR/issue agent transcripts: redact, preview, and insert safely.

steipete/beeper

Beeper cache: contact hints, room lookup, WhatsApp/iMessage traces, FTS.

steipete/browser-use

Existing Chrome automation: Chrome plugin first, mcporter fallback.

steipete/clawsweeper-status

ClawSweeper status: URLs, workflow health, active workers, ops snapshot.

steipete/clickclack

ClickClack ops: chat app, Hetzner deploy, DNS/docs/app, Docker rollout.

steipete/cloudflare-registrar

Cloudflare Registrar: domain availability, prices, registration via mcporter.

steipete/codex-debugging

Codex debugging: codex-rs core/tui/exec/cli/app-server/config.

steipete/create-cli

CLI UX/spec: args, flags, help, output, errors, config, dry-run.

steipete/discord-clawd

Discord-backed OpenClaw agent/session relay; not archive search.

steipete/domain-dns-ops

DNS/domain ops: registrars, zones, redirects, DNS/HTTP verify, manager truth.

steipete/frontend-design

Frontend UI: pages, apps, components, polished non-generic design.

steipete/github-author-context

GitHub contributor context: identity, activity, trust, company/team signal.

steipete/github-cache-hygiene

GitHub quota/cache hygiene: gh, ghx, xcache, gitcrawl, mirrors, limits.

steipete/github-deep-review

GitHub deep review: bugs, PRs, best fix, stale-or-real, read code first.

steipete/github-project-triage

GitHub issue/PR triage: queues, CI, blockers, risk, proof, next actions.

steipete/hopper-debugger

Hopper debugging: macOS/iOS binaries, ObjC/Swift symbols, dyld, LLDB.

steipete/instruments-profiling

Instruments/xctrace profiling: macOS/iOS traces, binaries, args, exports.

steipete/mac-maintenance

Mac upkeep: brew update/upgrade, pull clean repos, empty Trash.

steipete/maintainer-orchestrator

Open-source maintainer orchestration: Codex app workers, work recovery, dependencies, vision, releases.

steipete/markdown-converter

Markdown conversion: PDF, Office, HTML, data, OCR, audio, ZIP, YouTube.

相关技能