OpenClaw
Introduction
OpenClaw 是一款開源的個人 AI 數位助理,讓你在各種通訊平台上擁有專屬的智慧管家。無論是自動回覆訊息、整理資訊、串接工作流程,OpenClaw 都能幫你搞定。
- YT: 解剖小龍蝦 — 以 OpenClaw 為例介紹 AI Agent 的運作原理 - YouTube
- 為什麼我拖了一個多月才開始使用OpenClaw? (附接入飛書完整詳細教程,新手必看)
- OpenClaw 教學:26 個 Tools + 53 個 Skills 完整指南 | WenHao Yu
Resources
Installation
- 【保姆级】OpenClaw 全网最细教学:安装→Skills实战→多Agent协作,1 小时全精通! | 小林的博客-AI学长
- YT: 【保姆级】OpenClaw 全网最细教学:安装→Skills实战→多Agent协作,1 小时全精通! - YouTube
With Docker
- OpenClaw Docker 部署完全指南:从零搭建你的私有 AI Agent
- Self-hosting OpenClaw with Docker and Tailscale on a $5 VPS
- Docker 部署 OpenClaw:从踩坑到跑通的完整记录 | Yuxu Ge
git clone https://github.com/openclaw/openclaw
cd openclaw
export OPENCLAW_IMAGE="ghcr.io/openclaw/openclaw:latest"
./scripts/docker/setup.sh
CLI Commands
Check
docker compose run --rm openclaw-cli status
docker compose run --rm openclaw-cli gateway status
Pairing required
Approve the device
docker compose run --rm openclaw-cli devices list
docker compose run --rm openclaw-cli devices approve <request-id>
Telegram
Configuration
Create a Bot from Telegram
- Open Telegram
- Chat with
@BotFather - Run
/newbot, follow prompts to create your bot, and save the token.- Bot Name: <whatever>
- Bot Username: <unique-name and must end in 'bot'>
Go to OpenClaw CLI
docker compose run --rm openclaw-cli channels add --channel telegram --token "<bot-token>"
Go to Telegram
- Open you-bot
- Send "Hi"
- Getting a pairing code "XXXXX"
Go to OpenClaw CLI
docker compose run --rm openclaw-cli pairing list telegram
docker compose run --rm openclaw-cli pairing approve telegram XXXXX
Done
Bot Commands
/btw: 題外話,在不打斷目前對話(主任務),可以臨時問一個小問題,其內容不會進入主對話的上下文。/subagent: 子代理,在不打斷目前對話(主任務),呼叫另一個代理執行其他任務,其任務結果會納入主任務的上下文。/new: 新對話,建立新的對話(任務),全新的上下文,可節省 Token 用量。
Gateway
Local only (default)
- 遠端存取可以使用 SSH Port Forwarding
~/.openclaw/openclaw.json :
"gateway": {
"port": 18789,
"mode": "local",
"bind": "loopback",
"controlUi": {
"allowedOrigins": [
"http://localhost:18789",
"http://127.0.0.1:18789"
]
},
"auth": {
"mode": "token",
"token": "YOUR-OPENCLAW-TOKEN"
},
Tailscale
openclaw.json 的 tailscale 功能不適用在 Docker 環境。
- Tailscale Console: Enable HTTPS Certicficates
- OpenClaw Host: Run
sudo tailscale serve --bg --https=443 127.0.0.1:18789tailscale serve status
- Change
~/.openclaw/openclaw.jsonas follows - Connect to tailnet, and then visit https://your-openclaw-device.tailnet-domain/?token=YOUR-TOKEN , such as https://dockers-vm.tailcb58c9.ts.net/ ?token=YOUR-TOKEN
~/.openclaw/openclaw.json :
- mode: local
- bind: loopback
- trustedProxies: ["127.0.0.1", "::1"]
- allowedOrigins: https://yourdevice.tailnet-domain
"gateway": {
"port": 18789,
"mode": "local",
"bind": "loopback",
"trustedProxies": ["127.0.0.1", "::1"],
"controlUi": {
"allowedOrigins": [
"http://localhost:18789",
"http://127.0.0.1:18789",
"https://yourdevice.tailnet-domain"
]
},
"auth": {
"mode": "token",
"token": "YOUR-OPENCLAW-TOKEN"
},
openclaw.json 的 tailscale 模式比較(不適用在 Docker 環境)
| 模式 | 存取範圍 | HTTPS | 認證 | 適用場景 |
| serve | 限 tailnet | 自動 | Tailscale identity headers/Token/Password | 個人使用 |
| funnel | 公眾網路 | 自動 | Password | Webhook |
| bind: "tailnet" | 限 tailnet | 無 | Token/Password | 低延遲 |
| off | 限 localhost | 無 | Token | SSH Port Forward |