2026-02-10 14:51:54 +08:00
|
|
|
|
# 前言
|
2026-02-10 17:21:08 +08:00
|
|
|
|
- https://github.com/openclaw/openclaw
|
|
|
|
|
|
- KM
|
|
|
|
|
|
- Clawdbot / Moltbot 上手体验 https://km.netease.com/v4/detail/blog/258496
|
|
|
|
|
|
- OpenClaw Agent 真实案例分析 https://km.netease.com/v4/detail/blog/258865
|
2026-02-11 20:39:19 +08:00
|
|
|
|
- 教程
|
|
|
|
|
|
- Clawdbot 完整配置指南 - Sylearn的文章 - 知乎 https://zhuanlan.zhihu.com/p/1999437992549447616
|
2026-02-13 13:51:51 +08:00
|
|
|
|
- 【别当冤大头!1分钟白嫖GLM官方大模型!】 https://www.bilibili.com/video/BV1t2c5z3E8Y/?share_source=copy_web&vd_source=fe8142e8e12816535feaeabd6f6cdc8e
|
2026-02-17 18:54:40 +08:00
|
|
|
|
- 其他Bot框架
|
|
|
|
|
|
- 【我厌倦了 OpenClaw,用回了 AstrBot【AstrBot 年度更新】】 https://www.bilibili.com/video/BV1FmZMBiEs9/?share_source=copy_web&vd_source=fe8142e8e12816535feaeabd6f6cdc8e
|
2026-02-13 12:04:03 +08:00
|
|
|
|
|
|
|
|
|
|
|
2026-02-13 20:28:50 +08:00
|
|
|
|
# Docker 部署
|
2026-02-13 12:04:03 +08:00
|
|
|
|
https://docs.openclaw.ai/install/docker
|
2026-02-13 20:28:50 +08:00
|
|
|
|
|
2026-02-14 10:04:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# OpenClaw本地操作命令
|
|
|
|
|
|
- openclaw onboard
|
|
|
|
|
|
- openclaw gateway
|
|
|
|
|
|
- openclaw gateway status
|
2026-02-15 01:21:24 +08:00
|
|
|
|
- openclaw configure
|
2026-02-15 10:52:57 +08:00
|
|
|
|
修改模型:
|
|
|
|
|
|
```
|
|
|
|
|
|
openclaw models set <provider/model>
|
|
|
|
|
|
```
|
2026-02-14 10:04:01 +08:00
|
|
|
|
|
|
|
|
|
|
# 查看日志
|
|
|
|
|
|
openclaw logs --follow
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# OpenClaw Docker
|
2026-02-13 20:28:50 +08:00
|
|
|
|
```c++
|
|
|
|
|
|
docker pull alpine/openclaw:main
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
1. git clone https://github.com/openclaw/openclaw.git
|
|
|
|
|
|
2. cd openclaw
|
|
|
|
|
|
3. 核心步骤:构建并启动 Docker 镜像(约 5–30 分钟)
|
|
|
|
|
|
1. (可选)加速:使用预构建镜像。如果不想本地构建(build 过程可能下载依赖较慢),设置环境变量跳过:`bash export OPENCLAW_IMAGE=alpine/openclaw # 或官方其他镜像(视最新可用)`
|
|
|
|
|
|
|
|
|
|
|
|
## 克隆 OpenClaw 仓库
|
|
|
|
|
|
bash 运行
|
|
|
|
|
|
```
|
|
|
|
|
|
git clone https://github.com/openclaw/openclaw.git
|
|
|
|
|
|
cd openclaw
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
github还需要添加一下代理。
|
|
|
|
|
|
|
2026-02-14 11:41:25 +08:00
|
|
|
|
git config --global --list
|
2026-02-13 20:28:50 +08:00
|
|
|
|
|
2026-02-14 11:41:25 +08:00
|
|
|
|
git config --global http.https://github.com.proxy http://192.168.50.151:2081
|
|
|
|
|
|
git config --global https.https://github.com.proxy http://192.168.50.151:2081
|
|
|
|
|
|
~~git config --global http.https://github.com.proxy http://192.168.50.100:20171
|
2026-02-14 10:38:04 +08:00
|
|
|
|
git config --global https.https://github.com.proxy http://192.168.50.100:20171
|
2026-02-14 11:41:25 +08:00
|
|
|
|
~~
|
|
|
|
|
|
git config --global --unset http.https://github.com.proxy
|
|
|
|
|
|
git config --global --unset https.https://github.com.proxy
|
2026-02-14 10:38:04 +08:00
|
|
|
|
|
2026-02-14 11:41:25 +08:00
|
|
|
|
git config --global --unset http.proxy
|
|
|
|
|
|
git config --global --unset https.proxy
|
2026-02-13 20:28:50 +08:00
|
|
|
|
|
|
|
|
|
|
export https_proxy="http://192.168.50.100:20171"
|
|
|
|
|
|
export http_proxy="http://192.168.50.100:20171"
|
2026-02-14 11:41:25 +08:00
|
|
|
|
export https_proxy="http://192.168.50.151:2081"
|
|
|
|
|
|
export http_proxy="http://192.168.50.151:2081"
|
|
|
|
|
|
|
2026-02-13 20:28:50 +08:00
|
|
|
|
|
|
|
|
|
|
取消代理
|
|
|
|
|
|
unset http_proxy https_proxy
|
2026-02-14 11:41:25 +08:00
|
|
|
|
unset http_proxy https_proxy all_proxy
|
2026-02-13 20:28:50 +08:00
|
|
|
|
|
2026-02-19 17:38:52 +08:00
|
|
|
|
Docker添加代理
|
|
|
|
|
|
https://zhuanlan.zhihu.com/p/703839288
|
|
|
|
|
|
|
2026-02-13 20:28:50 +08:00
|
|
|
|
## 核心步骤:构建并启动 Docker 镜像(约 5–30 分钟)
|
|
|
|
|
|
### (可选)加速:使用预构建镜像
|
|
|
|
|
|
如果不想本地构建(build 过程可能下载依赖较慢),设置环境变量跳过:
|
|
|
|
|
|
bash运行
|
|
|
|
|
|
```
|
|
|
|
|
|
export OPENCLAW_IMAGE=alpine/openclaw # 或官方其他镜像(视最新可用)
|
2026-02-14 11:41:25 +08:00
|
|
|
|
|
|
|
|
|
|
unset OPENCLAW_IMAGE
|
2026-02-13 20:28:50 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### 运行官方 setup 脚本
|
|
|
|
|
|
bash运行
|
|
|
|
|
|
```
|
|
|
|
|
|
./docker-setup.sh # 明确用新 bash 执行
|
|
|
|
|
|
```
|
|
|
|
|
|
脚本会完成以下操作:
|
|
|
|
|
|
- 拉取 / 构建镜像(openclaw:local)
|
|
|
|
|
|
- 创建~/.openclaw(配置)和~/openclaw/workspace(沙箱目录)
|
|
|
|
|
|
- 启动 docker-compose 服务
|
|
|
|
|
|
|
|
|
|
|
|
构建过程会输出进度,如果卡在 100%,耐心等或检查网络 / 代理。
|
|
|
|
|
|
|
|
|
|
|
|
## 常见坑点处理
|
|
|
|
|
|
1. 报 `declare -A: invalid option` → 确认用 bash 5.x 执行(上文已解决)
|
|
|
|
|
|
2. 报 `Cannot connect to the Docker daemon` → 启动 Docker Desktop,或执行 `docker context use desktop-linux`
|
|
|
|
|
|
3. 权限问题 → 执行 `sudo chown -R $USER ~/.openclaw ~/openclaw/workspace`
|
|
|
|
|
|
|
|
|
|
|
|
## 配置与首次使用(Onboarding)
|
|
|
|
|
|
### 启动 onboarding wizard
|
|
|
|
|
|
bash运行
|
|
|
|
|
|
```
|
|
|
|
|
|
docker compose run --rm openclaw-cli wizard
|
|
|
|
|
|
```
|
|
|
|
|
|
1. 选择 QuickStart(推荐,新手友好,后续可手动调整)
|
|
|
|
|
|
2. 阅读安全警告 → 输入 Yes 继续
|
|
|
|
|
|
3. 输入模型 API Key(推荐 Groq、Claude、OpenAI 等)
|
|
|
|
|
|
4. 配置通道(Telegram/Discord 推荐先用一个)
|
|
|
|
|
|
5. 生成 pairing code → 在对应平台发给 bot 配对
|
|
|
|
|
|
|
|
|
|
|
|
### 批准配对(以 Discord 为例)
|
|
|
|
|
|
bash运行
|
|
|
|
|
|
```
|
|
|
|
|
|
docker compose run --rm openclaw-cli pairing approve discord <你的配对码>
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### 验证
|
|
|
|
|
|
bash运行
|
|
|
|
|
|
```
|
|
|
|
|
|
docker compose run --rm openclaw-cli devices list
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## 测试
|
|
|
|
|
|
1. 在 Discord/Telegram 发消息给 bot(如 “你好”)
|
|
|
|
|
|
2. 查看日志确认:
|
|
|
|
|
|
|
|
|
|
|
|
bash运行
|
|
|
|
|
|
```
|
|
|
|
|
|
docker compose logs -f
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## 日常管理命令
|
|
|
|
|
|
- 启动 / 重启:`docker compose up -d` / `docker compose restart`
|
|
|
|
|
|
- 停止:`docker compose down`
|
|
|
|
|
|
- 查看状态:`docker compose ps`
|
|
|
|
|
|
- 打开 Web Dashboard:`docker compose run --rm openclaw-cli dashboard`(通常 [localhost:18789](https://localhost:18789))
|
|
|
|
|
|
- 安全审计:`docker compose exec openclaw-gateway openclaw security audit --deep`
|
|
|
|
|
|
|
|
|
|
|
|
## 安全提醒
|
|
|
|
|
|
1. Docker 提供隔离,但仍需谨慎开启工具(如文件读写、shell 执行)。
|
|
|
|
|
|
2. 不要把高危权限给 bot,启用 allowlist、mention gating。
|
|
|
|
|
|
3. 定期运行 `openclaw security audit --fix`。
|
|
|
|
|
|
4. API Key 等敏感信息存储在~/.openclaw/,备份好。
|
|
|
|
|
|
|
|
|
|
|
|
## 总结
|
|
|
|
|
|
在 macOS 上通过 Docker 安装 OpenClaw 非常可靠,整体流程为:
|
|
|
|
|
|
**准备(Homebrew + bash 升级 + Docker)→ 克隆仓库 → bash ./docker-setup.sh → wizard 配置 → pairing 批准 → 测试聊天**
|
|
|
|
|
|
整个过程 30–60 分钟就能跑起本地个人 AI 助手,强烈推荐 Docker 方式,避免直接污染系统。
|
2026-02-14 10:04:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Channel
|
|
|
|
|
|
- 添加命令:openclaw channels add
|
|
|
|
|
|
## 飞书
|
|
|
|
|
|
- 【【小白入门教程】openclaw(clawdbot)安装部署教程,接入飞书/钉钉/QQ等聊天工具,5分钟学会,详细教程】 https://www.bilibili.com/video/BV1jBcaz6E6P/?share_source=copy_web&vd_source=fe8142e8e12816535feaeabd6f6cdc8e
|
|
|
|
|
|
|
|
|
|
|
|
AppID:cli_a90596306738dcc7
|
|
|
|
|
|
AppSecret:JZfGrXKRkwCE4a5yYvKZ2bSrOM1jZsDV
|
|
|
|
|
|
|
|
|
|
|
|
## QQ
|
|
|
|
|
|
https://github.com/sliverp/qqbot
|
|
|
|
|
|
|
2026-02-15 01:21:24 +08:00
|
|
|
|
## IMessage
|
|
|
|
|
|
https://cloud.tencent.com/developer/article/2626310
|