Skip to content

Instantly share code, notes, and snippets.

@sing1ee
Created March 2, 2026 06:58
Show Gist options
  • Select an option

  • Save sing1ee/b0fa6438a28d2bce1aa2ca42f280b060 to your computer and use it in GitHub Desktop.

Select an option

Save sing1ee/b0fa6438a28d2bce1aa2ca42f280b060 to your computer and use it in GitHub Desktop.

配置步骤:

# 1. 安装 acpx 插件
openclaw plugins install @openclaw/acpx

# 2. 配置 OpenClaw(.OPENCLAW 是你的 config 目录)
openclaw config set plugins.entries.acpx.enabled true
openclaw config set plugins.entries.acpx.config.permissionMode approve-all
openclaw config set acp.enabled true
openclaw config set acp.dispatch.enabled true
openclaw config set acp.backend acpx
openclaw config set acp.defaultAgent claude

# 3. 重启 gateway

或者直接编辑 ~/.openclaw/config.json

{
  "plugins": {
    "entries": {
      "acpx": {
        "enabled": true,
        "config": {
          "permissionMode": "approve-all"
        }
      }
    }
  },
  "acp": {
    "enabled": true,
    "dispatch": { "enabled": true },
    "backend": "acpx",
    "defaultAgent": "claude"
  }
}

然后验证:

/acp doctor
/acp spawn claude --mode persistent --thread auto

该怎么用呢?

简单用法:

方法一:直接对话

你: "用 Claude Code 帮我重构这个函数"

OpenClaw 会自动走 ACP 路由到 Claude Code(如果你配置了 acp.defaultAgent: claude)。


方法二:手动 spawn 会话

/acp spawn claude --mode persistent --thread auto

然后在同一 thread 里继续对话,所有内容会发给 Claude Code。


方法三:用 sessions_spawn 工具

{
  "task": "帮我写个测试",
  "runtime": "acp",
  "agentId": "claude",
  "thread": true,
  "mode": "session"
}

常用命令

命令 作用
/acp status 查看当前会话状态
/acp steer <指令> 发送 steer 指令给正在运行的会话
/acp cancel 取消当前 turn
/acp close 关闭会话

关键点: ACP 会话是非交互式的,所以 permissionMode: approve-all 是必须的,否则写文件/exec 命令会失败。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment