官网:https://openclaw.ai
文档:https://docs.openclaw.ai
部署
环境
Mac/Linux
curl -fsSL https://openclaw.ai/install.sh | bash
Windows
在powershell里运行
iwr -useb https://openclaw.ai/install.ps1 | iex
Docker 【办公电脑推荐】
官方的docker启动方式。熟悉docker的老师们都知道,docker-compose的配置应该是可以单独拉起来的,官方的docker-compose配置的并不好,它还需要在git repo上去执行一个shell脚本才能拉起。而且shell脚本读到 .env 的环境变量不会应用给子进程,因为.env里的环境变量都没有export。导致要准备两份环境变量文件,一份是.env提供给docker-compose加载。一份是对于每个环境变量都进行export,然后在跑脚本之前,先source这一份。并且在启动后,会因为配置不全,导致启动失败,需要看日志去补齐配置。
git clone https://github.com/openclaw/openclaw.git
cd openclaw
./docker-setup.sh
基于以上的原因,我重新配了一份dockerfile,构建了新的镜像,新镜像可以直接使用一份docker-compose配置进行拉起。
https://github.com/tenfyzhong/openclaw-docker
services:
openclaw-gateway:
image: tenfyzhong/openclaw:${OPENCLAW_VERSION:-latest}
environment:
HOME: /home/node
TERM: xterm-256color
OPENCLAW_GATEWAY_BIND: ${OPENCLAW_GATEWAY_BIND:-lan}
OPENCLAW_GATEWAY_PORT: ${OPENCLAW_GATEWAY_PORT:-18789}
OPENCLAW_BRIDGE_PORT: ${OPENCLAW_BRIDGE_PORT:-18790}
OPENCLAW_GATEWAY_TOKEN: ${OPENCLAW_GATEWAY_TOKEN:-}
OPENCLAW_ALLOW_INSECURE_PRIVATE_WS: ${OPENCLAW_ALLOW_INSECURE_PRIVATE_WS:-}
OPENCLAW_INIT_GATEWAY_MODE: ${OPENCLAW_INIT_GATEWAY_MODE:-local}
# Optional JSON array string, for example: ["https://control.example.com"]
OPENCLAW_INIT_CONTROL_UI_ALLOWED_ORIGINS: ${OPENCLAW_INIT_CONTROL_UI_ALLOWED_ORIGINS:-}
# Initial value used only when openclaw.json is generated for the first time.
OPENCLAW_GATEWAY_CONTROLUI_DANGEROUSLY_ALLOW_HOST_HEADER_ORIGIN_FALLBACK: ${OPENCLAW_GATEWAY_CONTROLUI_DANGEROUSLY_ALLOW_HOST_HEADER_ORIGIN_FALLBACK:-false}
CLAUDE_AI_SESSION_KEY: ${CLAUDE_AI_SESSION_KEY:-}
CLAUDE_WEB_SESSION_KEY: ${CLAUDE_WEB_SESSION_KEY:-}
CLAUDE_WEB_COOKIE: ${CLAUDE_WEB_COOKIE:-}
volumes:
- ${OPENCLAW_CONFIG_DIR:-./openclaw-data}:/home/node/.openclaw
- ${OPENCLAW_WORKSPACE_DIR:-./openclaw-data/workspace}:/home/node/.openclaw/workspace
## Uncomment the line below to pass host Docker socket into the container.
# - /var/run/docker.sock:/var/run/docker.sock
ports:
- "${OPENCLAW_GATEWAY_PORT:-18789}:18789"
- "${OPENCLAW_BRIDGE_PORT:-18790}:18790"
init: true
restart: unless-stopped
command: ["gateway"]
healthcheck:
test: ["CMD", "node", "-e", "const p=process.env.OPENCLAW_GATEWAY_PORT||'18789';fetch('http://127.0.0.1:'+p+'/healthz').then((r)=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
interval: 30s
timeout: 5s
retries: 5
start_period: 20s
启动
docker compose up -d
容器启动之后,进行配置
docker compose exec openclaw-gateway bash # 配置的过程中,可能会因为gateway重启,导致容器重启,当前的这个会话会退出,需要重新进入
配置
openclaw onboard
Channel
飞书
飞书官方插件: https://www.feishu.cn/content/article/7613711414611463386
- 创建应用
https://open.feishu.cn/app

- 添加机器人能力

- 导入权限
以下是最小不用审批的权限。
{
"scopes": {
"tenant": [
"contact:contact.base:readonly",
"im:chat",
"im:message",
"im:message.group_at_msg:readonly",
"im:message.group_msg",
"im:message.p2p_msg:readonly",
"im:message:readonly",
"im:message:send_as_bot"
],
"user": [
"cardkit:card:write"
]
}
}

进行发布一次
- 设置长链接,需要 openclaw 配置好 openclaw channels 再调用
添加事件 im.message.receive_v1

-
发布应用
- 选择可用范围(只有范围内的人可用看到机器人)
- 选择具体的人可用不用走申请
- 飞书账号配对
跟机器发第一条消息后,会让我们去openclaw上配对
openclaw pairing approve feishu ****
https://q.qq.com/qqbot/openclaw/index.html
openclaw plugins install @tencent-connect/openclaw-qqbot@latest
openclaw channels add --channel qqbot --token "1903510527:XyB9sWw7Vkl"
openclaw gateway restart
模型
登录 openai-codex
openclaw models auth login --provider openai-codex
Use case
对生产集群进行巡检

做集群测试

工作日对A股进行盘前预案、午盘总结、盘后复盘

每天自动发博客
https://clawmood.tenfy.cn


爬虫
https://docs.google.com/spreadsheets/d/1xhsRDnzI7vvMY-azQ2z43i2LYMTNFsVNWwkLnYlUJiQ/edit?gid=1459894809#gid=1459894809

Mem9:多个openclaw共享记忆
https://mem9.ai



