{"id":44,"date":"2026-03-21T22:47:14","date_gmt":"2026-03-21T14:47:14","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/cli-acp\/"},"modified":"2026-03-21T23:08:55","modified_gmt":"2026-03-21T15:08:55","slug":"cli-acp","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/cli-acp\/","title":{"rendered":"acp"},"content":{"rendered":"<h1>acp<\/h1>\n<p>\u8fd0\u884c\u4e0e OpenClaw Gateway \u7f51\u5173\u901a\u4fe1\u7684 ACP\uff08Agent Client Protocol\uff09\u6865\u63a5\u5668\u3002<\/p>\n<p>\u6b64\u547d\u4ee4\u901a\u8fc7 stdio \u4f7f\u7528 ACP \u534f\u8bae\u4e0e IDE \u901a\u4fe1\uff0c\u5e76\u901a\u8fc7 WebSocket \u5c06\u63d0\u793a\u8f6c\u53d1\u5230 Gateway \u7f51\u5173\u3002\u5b83\u5c06 ACP \u4f1a\u8bdd\u6620\u5c04\u5230 Gateway \u7f51\u5173\u4f1a\u8bdd\u952e\u3002<\/p>\n<h2>\u7528\u6cd5<\/h2>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw acp<\/p>\n<h1>Remote Gateway<\/h1>\n<p>openclaw acp &#8211;url wss:\/\/gateway-host:18789 &#8211;token <\/p>\n<h1>Attach to an existing session key<\/h1>\n<p>openclaw acp &#8211;session agent:main:main<\/p>\n<h1>Attach by label (must already exist)<\/h1>\n<p>openclaw acp &#8211;session-label &#8220;support inbox&#8221;<\/p>\n<h1>Reset the session key before the first prompt<\/h1>\n<p>openclaw acp &#8211;session agent:main:main &#8211;reset-session<\/p>\n<pre><code>\n## ACP \u5ba2\u6237\u7aef\uff08\u8c03\u8bd5\uff09\n\n\u4f7f\u7528\u5185\u7f6e ACP \u5ba2\u6237\u7aef\u5728\u6ca1\u6709 IDE \u7684\u60c5\u51b5\u4e0b\u68c0\u67e5\u6865\u63a5\u5668\u7684\u5b89\u88c5\u5b8c\u6574\u6027\u3002\n\u5b83\u4f1a\u542f\u52a8 ACP \u6865\u63a5\u5668\u5e76\u8ba9\u4f60\u4ea4\u4e92\u5f0f\u8f93\u5165\u63d0\u793a\u3002\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nopenclaw acp client\n\n# Point the spawned bridge at a remote Gateway\nopenclaw acp client --server-args --url wss:\/\/gateway-host:18789 --token &lt;token&gt;\n\n# Override the server command (default: openclaw)\nopenclaw acp client --server &quot;node&quot; --server-args openclaw.mjs acp --url ws:\/\/127.0.0.1:19001\n<\/code><\/pre>\n<h2>\u5982\u4f55\u4f7f\u7528<\/h2>\n<p>\u5f53 IDE\uff08\u6216\u5176\u4ed6\u5ba2\u6237\u7aef\uff09\u4f7f\u7528 Agent Client Protocol \u5e76\u4e14\u4f60\u5e0c\u671b\u5b83\u9a71\u52a8 OpenClaw Gateway \u7f51\u5173\u4f1a\u8bdd\u65f6\uff0c\u8bf7\u4f7f\u7528 ACP\u3002<\/p>\n<ol>\n<li>\u786e\u4fdd Gateway \u7f51\u5173\u6b63\u5728\u8fd0\u884c\uff08\u672c\u5730\u6216\u8fdc\u7a0b\uff09\u3002<\/li>\n<li>\u914d\u7f6e Gateway \u7f51\u5173\u76ee\u6807\uff08\u914d\u7f6e\u6216\u6807\u5fd7\uff09\u3002<\/li>\n<li>\u5c06\u4f60\u7684 IDE \u914d\u7f6e\u4e3a\u901a\u8fc7 stdio \u8fd0\u884c <code>openclaw acp<\/code>\u3002<\/li>\n<\/ol>\n<p>\u793a\u4f8b\u914d\u7f6e\uff08\u6301\u4e45\u5316\uff09\uff1a<\/p>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw config set gateway.remote.url wss:\/\/gateway-host:18789<br \/>\nopenclaw config set gateway.remote.token <\/p>\n<pre><code>\n\u793a\u4f8b\u76f4\u63a5\u8fd0\u884c\uff08\u4e0d\u5199\u5165\u914d\u7f6e\uff09\uff1a\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nopenclaw acp --url wss:\/\/gateway-host:18789 --token &lt;token&gt;\n<\/code><\/pre>\n<h2>\u9009\u62e9\u667a\u80fd\u4f53<\/h2>\n<p>ACP \u4e0d\u76f4\u63a5\u9009\u62e9\u667a\u80fd\u4f53\u3002\u5b83\u901a\u8fc7 Gateway \u7f51\u5173\u4f1a\u8bdd\u952e\u8fdb\u884c\u8def\u7531\u3002<\/p>\n<p>\u4f7f\u7528\u667a\u80fd\u4f53\u4f5c\u7528\u57df\u7684\u4f1a\u8bdd\u952e\u6765\u5b9a\u4f4d\u7279\u5b9a\u667a\u80fd\u4f53\uff1a<\/p>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw acp &#8211;session agent:main:main<br \/>\nopenclaw acp &#8211;session agent:design:main<br \/>\nopenclaw acp &#8211;session agent:qa:bug-123<\/p>\n<pre><code>\n\u6bcf\u4e2a ACP \u4f1a\u8bdd\u6620\u5c04\u5230\u5355\u4e2a Gateway \u7f51\u5173\u4f1a\u8bdd\u952e\u3002\u4e00\u4e2a\u667a\u80fd\u4f53\u53ef\u4ee5\u6709\u591a\u4e2a\u4f1a\u8bdd\uff1b\u9664\u975e\u4f60\u8986\u76d6\u952e\u6216\u6807\u7b7e\uff0c\u5426\u5219 ACP \u9ed8\u8ba4\u4f7f\u7528\u9694\u79bb\u7684 `acp:&lt;uuid&gt;` \u4f1a\u8bdd\u3002\n\n## Zed \u7f16\u8f91\u5668\u8bbe\u7f6e\n\n\u5728 `~\/.config\/zed\/settings.json` \u4e2d\u6dfb\u52a0\u81ea\u5b9a\u4e49 ACP \u667a\u80fd\u4f53\uff08\u6216\u4f7f\u7528 Zed \u7684\u8bbe\u7f6e\u754c\u9762\uff09\uff1a\n\n```json  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n{\n  &quot;agent_servers&quot;: {\n    &quot;OpenClaw ACP&quot;: {\n      &quot;type&quot;: &quot;custom&quot;,\n      &quot;command&quot;: &quot;openclaw&quot;,\n      &quot;args&quot;: [&quot;acp&quot;],\n      &quot;env&quot;: {}\n    }\n  }\n}\n<\/code><\/pre>\n<p>\u8981\u5b9a\u4f4d\u7279\u5b9a\u7684 Gateway \u7f51\u5173\u6216\u667a\u80fd\u4f53\uff1a<\/p>\n<p>&#8220;`json  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n{<br \/>\n  &#8220;agent_servers&#8221;: {<br \/>\n    &#8220;OpenClaw ACP&#8221;: {<br \/>\n      &#8220;type&#8221;: &#8220;custom&#8221;,<br \/>\n      &#8220;command&#8221;: &#8220;openclaw&#8221;,<br \/>\n      &#8220;args&#8221;: [<br \/>\n        &#8220;acp&#8221;,<br \/>\n        &#8220;&#8211;url&#8221;,<br \/>\n        &#8220;wss:\/\/gateway-host:18789&#8221;,<br \/>\n        &#8220;&#8211;token&#8221;,<br \/>\n        &#8220;&#8221;,<br \/>\n        &#8220;&#8211;session&#8221;,<br \/>\n        &#8220;agent:design:main&#8221;<br \/>\n      ],<br \/>\n      &#8220;env&#8221;: {}<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<pre><code>\n\u5728 Zed \u4e2d\uff0c\u6253\u5f00 Agent \u9762\u677f\u5e76\u9009\u62e9&quot;OpenClaw ACP&quot;\u6765\u5f00\u59cb\u4e00\u4e2a\u4f1a\u8bdd\u3002\n\n## \u4f1a\u8bdd\u6620\u5c04\n\n\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cACP \u4f1a\u8bdd\u83b7\u5f97\u4e00\u4e2a\u5e26\u6709 `acp:` \u524d\u7f00\u7684\u9694\u79bb Gateway \u7f51\u5173\u4f1a\u8bdd\u952e\u3002\n\u8981\u91cd\u7528\u5df2\u77e5\u4f1a\u8bdd\uff0c\u8bf7\u4f20\u9012\u4f1a\u8bdd\u952e\u6216\u6807\u7b7e\uff1a\n\n* `--session &lt;key&gt;`\uff1a\u4f7f\u7528\u7279\u5b9a\u7684 Gateway \u7f51\u5173\u4f1a\u8bdd\u952e\u3002\n* `--session-label &lt;label&gt;`\uff1a\u901a\u8fc7\u6807\u7b7e\u89e3\u6790\u73b0\u6709\u4f1a\u8bdd\u3002\n* `--reset-session`\uff1a\u4e3a\u8be5\u952e\u751f\u6210\u65b0\u7684\u4f1a\u8bdd ID\uff08\u76f8\u540c\u952e\uff0c\u65b0\u5bf9\u8bdd\u8bb0\u5f55\uff09\u3002\n\n\u5982\u679c\u4f60\u7684 ACP \u5ba2\u6237\u7aef\u652f\u6301\u5143\u6570\u636e\uff0c\u4f60\u53ef\u4ee5\u6309\u4f1a\u8bdd\u8986\u76d6\uff1a\n\n```json  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n{\n  &quot;_meta&quot;: {\n    &quot;sessionKey&quot;: &quot;agent:main:main&quot;,\n    &quot;sessionLabel&quot;: &quot;support inbox&quot;,\n    &quot;resetSession&quot;: true\n  }\n}\n<\/code><\/pre>\n<p>\u5728 <a href=\"\/concepts\/session\">\/concepts\/session<\/a> \u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u4f1a\u8bdd\u952e\u7684\u4fe1\u606f\u3002<\/p>\n<h2>\u9009\u9879<\/h2>\n<ul>\n<li><code>--url &lt;url&gt;<\/code>\uff1aGateway \u7f51\u5173 WebSocket URL\uff08\u914d\u7f6e\u540e\u9ed8\u8ba4\u4e3a gateway.remote.url\uff09\u3002<\/li>\n<li><code>--token &lt;token&gt;<\/code>\uff1aGateway \u7f51\u5173\u8ba4\u8bc1\u4ee4\u724c\u3002<\/li>\n<li><code>--password &lt;password&gt;<\/code>\uff1aGateway \u7f51\u5173\u8ba4\u8bc1\u5bc6\u7801\u3002<\/li>\n<li><code>--session &lt;key&gt;<\/code>\uff1a\u9ed8\u8ba4\u4f1a\u8bdd\u952e\u3002<\/li>\n<li><code>--session-label &lt;label&gt;<\/code>\uff1a\u8981\u89e3\u6790\u7684\u9ed8\u8ba4\u4f1a\u8bdd\u6807\u7b7e\u3002<\/li>\n<li><code>--require-existing<\/code>\uff1a\u5982\u679c\u4f1a\u8bdd\u952e\/\u6807\u7b7e\u4e0d\u5b58\u5728\u5219\u5931\u8d25\u3002<\/li>\n<li><code>--reset-session<\/code>\uff1a\u5728\u9996\u6b21\u4f7f\u7528\u524d\u91cd\u7f6e\u4f1a\u8bdd\u952e\u3002<\/li>\n<li><code>--no-prefix-cwd<\/code>\uff1a\u4e0d\u5728\u63d0\u793a\u524d\u6dfb\u52a0\u5de5\u4f5c\u76ee\u5f55\u524d\u7f00\u3002<\/li>\n<li><code>--verbose, -v<\/code>\uff1a\u5411 stderr \u8f93\u51fa\u8be6\u7ec6\u65e5\u5fd7\u3002<\/li>\n<\/ul>\n<h3><code>acp client<\/code> \u9009\u9879<\/h3>\n<ul>\n<li><code>--cwd &lt;dir&gt;<\/code>\uff1aACP \u4f1a\u8bdd\u7684\u5de5\u4f5c\u76ee\u5f55\u3002<\/li>\n<li><code>--server &lt;command&gt;<\/code>\uff1aACP \u670d\u52a1\u5668\u547d\u4ee4\uff08\u9ed8\u8ba4\uff1a<code>openclaw<\/code>\uff09\u3002<\/li>\n<li><code>--server-args &lt;args...&gt;<\/code>\uff1a\u4f20\u9012\u7ed9 ACP \u670d\u52a1\u5668\u7684\u989d\u5916\u53c2\u6570\u3002<\/li>\n<li><code>--server-verbose<\/code>\uff1a\u542f\u7528 ACP \u670d\u52a1\u5668\u7684\u8be6\u7ec6\u65e5\u5fd7\u3002<\/li>\n<li><code>--verbose, -v<\/code>\uff1a\u8be6\u7ec6\u5ba2\u6237\u7aef\u65e5\u5fd7\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>acp \u8fd0\u884c\u4e0e OpenClaw Gateway \u7f51\u5173\u901a\u4fe1\u7684 ACP\uff08Agent Client Protoco [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-44","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=44"}],"version-history":[{"count":1,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/44\/revisions"}],"predecessor-version":[{"id":339,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/44\/revisions\/339"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}