ClawDock 是 Docker 化 OpenClaw 安装的 shell 助手层,提供简短命令替代冗长的 docker compose ... 调用。

安装

mkdir -p ~/.clawdock && curl -sL https://raw.githubusercontent.com/openclaw/openclaw/main/scripts/clawdock/clawdock-helpers.sh \
  -o ~/.clawdock/clawdock-helpers.sh
echo 'source ~/.clawdock/clawdock-helpers.sh' >> ~/.zshrc && source ~/.zshrc

若之前从旧路径 scripts/shell-helpers/clawdock-helpers.sh 安装,需重新安装。

命令速查

基础操作

命令说明
clawdock-start启动 Gateway
clawdock-stop停止 Gateway
clawdock-restart重启 Gateway
clawdock-status查看容器状态
clawdock-logs跟踪 Gateway 日志

容器访问

命令说明
clawdock-shell进入容器 shell
clawdock-cli <cmd>在 Docker 中运行 OpenClaw CLI
clawdock-exec <cmd>在容器中执行任意命令

Web UI 与配对

命令说明
clawdock-dashboard打开 Control UI URL
clawdock-devices列出待配对设备
clawdock-approve <id>批准配对请求

维护

命令说明
clawdock-fix-token配置容器内 gateway token
clawdock-update拉取、重建、重启
clawdock-rebuild仅重建 Docker 镜像
clawdock-clean删除容器和卷

工具

命令说明
clawdock-health运行 gateway 健康检查
clawdock-token打印 gateway token
clawdock-show-config打印配置文件(隐藏敏感值)

首次使用流程

clawdock-start
clawdock-fix-token
clawdock-dashboard
 
# 若浏览器提示需要配对
clawdock-devices
clawdock-approve <request-id>

配置文件位置

  • <project>/.env — Docker 相关值(镜像名、端口、gateway token)
  • ~/.openclaw/.env — env 形式的 provider keys 和 bot tokens
  • ~/.openclaw/agents/<agentId>/agent/auth-profiles.json — OAuth/API key auth
  • ~/.openclaw/openclaw.json — 行为配置

相关链接