OpenClawSkills
GitHub
CLI 参考 • 5 分钟阅读

节点

“openclaw node”的 CLI 参考(无头节点主机)

Run a headless node host that connects to gateway WebSocket and exposes

''system.run'' / ''system.which'' on the local machine.

Tutorial.step

为什么使用节点主机?

当您希望代理在您的网络中的其他计算机上运行命令时,请使用节点主机

网络,而无需在那里安装完整的 macOS 配套应用程序。

常见用例:

- 在远程 Linux/Windows 机器(构建服务器、实验室机器、NAS)上运行命令。

- 在网关上保持执行沙盒化,但将批准的运行委托给其他主机。

- 为自动化或 CI 节点提供轻量级、无头执行目标。

执行仍然受到执行批准和节点主机上每个代理允许列表的保护,

因此您可以保持命令访问范围明确。

Tutorial.step

浏览器代理(零配置)

如果 ''browser.enabled'' 不是,节点主机会自动通告浏览器代理

在节点上禁用。这允许代理在该节点上使用浏览器自动化

如果需要,请在节点上禁用它:

Json5
{
  nodeHost: {
    browserProxy: {
      enabled: false,
    },
  },
}
Tutorial.step

运行(前台)

Bash
openclaw node run --host <gateway-host> --port 18789

选项:

- ''--host <host>'': Gateway WebSocket host (default: ''127.0.0.1'')

- ''--port <port>'': Gateway WebSocket port (default: ''18789'')

- ''--tls'':使用 TLS 进行网关连接

- ''--tls-fingerprint <sha256>'': Expected TLS certificate fingerprint (sha256)

- ''--node-id <id>'': Override node ID (clears pairing token)

Tutorial.step

服务(背景)

将无头节点主机安装为用户服务。

Bash
openclaw node install --host <gateway-host> --port 18789

选项:

- ''--host <host>'': Gateway WebSocket host (default: ''127.0.0.1'')

- ''--port <port>'': Gateway WebSocket port (default: ''18789'')

- ''--tls'':使用 TLS 进行网关连接

- ''--tls-fingerprint <sha256>'': Expected TLS certificate fingerprint (sha256)

- ''--node-id <id>'': Override node ID (clears pairing token)

- ''--display-name <name>'': Override node display name

- ''--runtime <runtime>'': Service runtime (''node'' or ''bun'')

- ''--force'':重新安装/覆盖(如果已安装)

管理服务:

Bash
openclaw node status
openclaw node stop
openclaw node restart
openclaw node uninstall

使用 ''openclaw node run'' 作为前台节点主机(无服务)。

服务命令接受 ''--json'' 作为机器可读的输出。

Tutorial.step

配对

第一个连接在网关上创建待处理的节点对请求。

通过以下方式批准:

Bash
openclaw nodes pending
openclaw nodes approve <requestId>

节点主机将其节点 ID、令牌、显示名称和网关连接信息存储在

''~/.openclaw/node.json''。

Tutorial.step

执行批准

''system.run'' 由本地执行人员批准:

- ''~/.openclaw/exec-approvals.json''

- ''执行批准''

- ''openclaw approvals --node <id|name|ip>'' (edit from gateway)