OpenClaw从入门到应用——CLI:Daemon

📅 2026/7/26 8:22:56 👁️ 阅读次数 📝 编程学习
OpenClaw从入门到应用——CLI:Daemon

通过OpenClaw实现副业收入:《OpenClaw赚钱实录:从“养龙虾“到可持续变现的实践指南》

用法

theme={"theme":{"light":"min-light","dark":"min-dark"}}openclaw daemon status openclaw daemoninstallopenclaw daemon start openclaw daemon stop openclaw daemon restart openclaw daemon uninstall

子命令

  • status:显示服务安装状态并探测网关健康情况
  • install:安装服务(launchd/systemd/schtasks
  • uninstall:移除服务
  • start:启动服务
  • stop:停止服务
  • restart:重启服务

通用选项

  • status--url--token--password--timeout--no-probe--deep--json
  • install--port--runtime--token--force--json
  • 生命周期命令(uninstall|start|stop|restart):--json

注意:

  • status会在可能时解析已配置的认证 SecretRef,用于探测时的认证。
  • 在 Linux systemd 安装中,status的 token 漂移检查会同时检查Environment=EnvironmentFile=单元来源。
  • 当令牌认证需要令牌并且gateway.auth.token由 SecretRef 管理时,install会验证该 SecretRef 是否可解析,但不会将解析后的令牌持久化到服务环境元数据中。
  • 如果令牌认证需要令牌,但配置的 token SecretRef 无法解析,则安装失败并终止。
  • 如果同时配置了gateway.auth.tokengateway.auth.password,且gateway.auth.mode未设置,则安装会被阻止,直到显式设置了 mode。

建议使用openclaw gateway查看最新的文档和示例。