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 — 行为配置
相关链接