|
| 1 | +--- |
| 2 | +read_when: |
| 3 | + - 向新用户介绍 OpenClaw |
| 4 | +summary: OpenClaw 的顶层概述、功能特性与用途 |
| 5 | +x-i18n: |
| 6 | + generated_at: "2026-02-01T13:34:09Z" |
| 7 | + model: claude-opus-4-5 |
| 8 | + provider: pi |
| 9 | + source_hash: 92462177964ac72c344d3e8613a3756bc8e06eb7844cda20a38cd43e7cadd3b2 |
| 10 | + source_path: index.md |
| 11 | + workflow: 9 |
| 12 | +--- |
| 13 | + |
| 14 | +# OpenClaw 🦞 |
| 15 | + |
| 16 | +> _"EXFOLIATE! EXFOLIATE!"_ — 大概是一只太空龙虾说的 |
| 17 | +
|
| 18 | +<p align="center"> |
| 19 | + <img |
| 20 | + src="/assets/openclaw-logo-text-dark.png" |
| 21 | + alt="OpenClaw" |
| 22 | + width="500" |
| 23 | + class="dark:hidden" |
| 24 | + /> |
| 25 | + <img |
| 26 | + src="/assets/openclaw-logo-text.png" |
| 27 | + alt="OpenClaw" |
| 28 | + width="500" |
| 29 | + class="hidden dark:block" |
| 30 | + /> |
| 31 | +</p> |
| 32 | + |
| 33 | +<p align="center"> |
| 34 | + <strong>适用于任意操作系统,通过 WhatsApp/Telegram/Discord/iMessage Gateway 连接 AI 智能体 (Pi)。</strong><br /> |
| 35 | + 插件可添加 Mattermost 等更多渠道支持。 |
| 36 | + 发送一条消息,即可获得智能体回复——随时随地,触手可及。 |
| 37 | +</p> |
| 38 | + |
| 39 | +<p align="center"> |
| 40 | + <a href="https://github.com/openclaw/openclaw">GitHub</a> · |
| 41 | + <a href="https://github.com/openclaw/openclaw/releases">版本发布</a> · |
| 42 | + <a href="/">文档</a> · |
| 43 | + <a href="/start/openclaw">OpenClaw 助手设置</a> |
| 44 | +</p> |
| 45 | + |
| 46 | +OpenClaw 将 WhatsApp(通过 WhatsApp Web / Baileys)、Telegram(Bot API / grammY)、Discord(Bot API / channels.discord.js)和 iMessage(imsg CLI)桥接至编程智能体,例如 [Pi](https://github.com/badlogic/pi-mono)。插件可添加 Mattermost(Bot API + WebSocket)等更多渠道支持。 |
| 47 | +OpenClaw 同时也驱动着 OpenClaw 助手。 |
| 48 | + |
| 49 | +## 从这里开始 |
| 50 | + |
| 51 | +- **从零开始全新安装:** [快速入门](/start/getting-started) |
| 52 | +- **引导式设置(推荐):** [向导](/start/wizard) (`openclaw onboard`) |
| 53 | +- **打开仪表盘(本地 Gateway):** http://127.0.0.1:18789/(或 http://localhost:18789/) |
| 54 | + |
| 55 | +如果 Gateway 运行在同一台计算机上,该链接会立即打开浏览器控制界面。如果无法打开,请先启动 Gateway: `openclaw gateway`. |
| 56 | + |
| 57 | +## 仪表盘(浏览器控制界面) |
| 58 | + |
| 59 | +仪表盘是用于聊天、配置、节点、会话等功能的浏览器控制界面。 |
| 60 | +本地默认地址:http://127.0.0.1:18789/ |
| 61 | +远程访问: [Web 界面](/web) 和 [Tailscale](/gateway/tailscale) |
| 62 | + |
| 63 | +<p align="center"> |
| 64 | + <img src="whatsapp-openclaw.jpg" alt="OpenClaw" width="420" /> |
| 65 | +</p> |
| 66 | + |
| 67 | +## 工作原理 |
| 68 | + |
| 69 | +``` |
| 70 | +WhatsApp / Telegram / Discord / iMessage (+ plugins) |
| 71 | + │ |
| 72 | + ▼ |
| 73 | + ┌───────────────────────────┐ |
| 74 | + │ Gateway │ ws://127.0.0.1:18789 (loopback-only) |
| 75 | + │ (single source) │ |
| 76 | + │ │ http://<gateway-host>:18793 |
| 77 | + │ │ /__openclaw__/canvas/ (Canvas host) |
| 78 | + └───────────┬───────────────┘ |
| 79 | + │ |
| 80 | + ├─ Pi agent (RPC) |
| 81 | + ├─ CLI (openclaw …) |
| 82 | + ├─ Chat UI (SwiftUI) |
| 83 | + ├─ macOS app (OpenClaw.app) |
| 84 | + ├─ iOS node via Gateway WS + pairing |
| 85 | + └─ Android node via Gateway WS + pairing |
| 86 | +``` |
| 87 | + |
| 88 | +大多数操作通过 **Gateway** (`openclaw gateway`进行,它是一个长期运行的单进程,负责管理渠道连接和 WebSocket 控制面。 |
| 89 | + |
| 90 | +## 网络模型 |
| 91 | + |
| 92 | +- **每台主机一个 Gateway(推荐)**:它是唯一允许持有 WhatsApp Web 会话的进程。如果需要备用机器人或严格隔离,可使用独立配置文件和端口运行多个 Gateway;请参阅 [多 Gateway 部署](/gateway/multiple-gateways). |
| 93 | +- **优先回环**:Gateway WS 默认监听 `ws://127.0.0.1:18789`. |
| 94 | + - 向导现在默认会生成一个 Gateway 令牌(即使在回环模式下也是如此)。 |
| 95 | + - 如需 Tailnet 访问,请运行 `openclaw gateway --bind tailnet --token ...` (非回环绑定时必须提供令牌)。 |
| 96 | +- **节点**:通过 WebSocket 连接到 Gateway(根据需要使用局域网/Tailnet/SSH);旧版 TCP 桥接已弃用/移除。 |
| 97 | +- **Canvas 主机**:HTTP 文件服务器运行在 `canvasHost.port` (默认 `18793`),提供 `/__openclaw__/canvas/` 用于节点 WebView;请参阅 [Gateway 配置](/gateway/configuration) (`canvasHost`)。 |
| 98 | +- **远程使用**:SSH 隧道或 Tailnet/VPN;请参阅 [远程访问](/gateway/remote) 和 [发现机制](/gateway/discovery). |
| 99 | + |
| 100 | +## 功能特性(概览) |
| 101 | + |
| 102 | +- 📱 **WhatsApp 集成** — 使用 Baileys 实现 WhatsApp Web 协议 |
| 103 | +- ✈️ **Telegram 机器人** — 通过 grammY 支持私聊和群组 |
| 104 | +- 🎮 **Discord 机器人** — 通过 channels.discord.js 支持私聊和服务器频道 |
| 105 | +- 🧩 **Mattermost 机器人(插件)** — Bot 令牌 + WebSocket 事件 |
| 106 | +- 💬 **iMessage** — 本地 imsg CLI 集成(macOS) |
| 107 | +- 🤖 **智能体桥接** — Pi(RPC 模式),支持工具流式传输 |
| 108 | +- ⏱️ **流式传输与分块** — 块流式传输 + Telegram 草稿流式传输详情([/concepts/streaming](/concepts/streaming)) |
| 109 | +- 🧠 **多智能体路由** — 将提供商账户/对等方路由到隔离的智能体(工作区 + 每智能体会话) |
| 110 | +- 🔐 **订阅认证** — 通过 OAuth 支持 Anthropic(Claude Pro/Max)+ OpenAI(ChatGPT/Codex) |
| 111 | +- 💬 **会话** — 私聊折叠为共享 `main` (默认);群组为隔离 |
| 112 | +- 👥 **群聊支持** — 默认基于提及触发;所有者可切换 `/activation always|mention` |
| 113 | +- 📎 **媒体支持** — 收发图片、音频、文档 |
| 114 | +- 🎤 **语音消息** — 可选的转录钩子 |
| 115 | +- 🖥️ **网页聊天 + macOS 应用** — 本地界面 + 菜单栏辅助工具,支持操作和语音唤醒 |
| 116 | +- 📱 **iOS 节点** — 作为节点配对并提供 Canvas 界面 |
| 117 | +- 📱 **Android 节点** — 作为节点配对并提供 Canvas + 聊天 + 相机 |
| 118 | + |
| 119 | +注意:旧版 Claude/Codex/Gemini/Opencode 路径已移除;Pi 是唯一的编程智能体路径。 |
| 120 | + |
| 121 | +## 快速开始 |
| 122 | + |
| 123 | +运行时要求: **Node ≥ 22**. |
| 124 | + |
| 125 | +```bash |
| 126 | +# Recommended: global install (npm/pnpm) |
| 127 | +npm install -g openclaw@latest |
| 128 | +# or: pnpm add -g openclaw@latest |
| 129 | + |
| 130 | +# Onboard + install the service (launchd/systemd user service) |
| 131 | +openclaw onboard --install-daemon |
| 132 | + |
| 133 | +# Pair WhatsApp Web (shows QR) |
| 134 | +openclaw channels login |
| 135 | + |
| 136 | +# Gateway runs via the service after onboarding; manual run is still possible: |
| 137 | +openclaw gateway --port 18789 |
| 138 | +``` |
| 139 | + |
| 140 | +之后在 npm 安装和 git 安装之间切换很简单:安装另一种方式并运行 `openclaw doctor` 以更新 Gateway 服务入口点。 |
| 141 | + |
| 142 | +从源码安装(开发): |
| 143 | + |
| 144 | +```bash |
| 145 | +git clone https://github.com/openclaw/openclaw.git |
| 146 | +cd openclaw |
| 147 | +pnpm install |
| 148 | +pnpm ui:build # auto-installs UI deps on first run |
| 149 | +pnpm build |
| 150 | +openclaw onboard --install-daemon |
| 151 | +``` |
| 152 | + |
| 153 | +如果尚未进行全局安装,请通过以下方式运行上手引导步骤 `pnpm openclaw ...` (在仓库目录中执行)。 |
| 154 | + |
| 155 | +多实例快速开始(可选): |
| 156 | + |
| 157 | +```bash |
| 158 | +OPENCLAW_CONFIG_PATH=~/.openclaw/a.json \ |
| 159 | +OPENCLAW_STATE_DIR=~/.openclaw-a \ |
| 160 | +openclaw gateway --port 19001 |
| 161 | +``` |
| 162 | + |
| 163 | +发送测试消息(需要 Gateway 正在运行): |
| 164 | + |
| 165 | +```bash |
| 166 | +openclaw message send --target +15555550123 --message "Hello from OpenClaw" |
| 167 | +``` |
| 168 | + |
| 169 | +## 配置(可选) |
| 170 | + |
| 171 | +配置文件位于 `~/.openclaw/openclaw.json`. |
| 172 | + |
| 173 | +- 如果你 **不做任何操作**,OpenClaw 将使用内置的 Pi 二进制文件以 RPC 模式运行,并采用按发送者区分的会话。 |
| 174 | +- 如果你想锁定访问权限,请从以下内容开始 `channels.whatsapp.allowFrom` 以及(针对群组的)提及规则。 |
| 175 | + |
| 176 | +示例: |
| 177 | + |
| 178 | +```json5 |
| 179 | +{ |
| 180 | + channels: { |
| 181 | + whatsapp: { |
| 182 | + allowFrom: ["+15555550123"], |
| 183 | + groups: { "*": { requireMention: true } }, |
| 184 | + }, |
| 185 | + }, |
| 186 | + messages: { groupChat: { mentionPatterns: ["@openclaw"] } }, |
| 187 | +} |
| 188 | +``` |
| 189 | + |
| 190 | +## 文档 |
| 191 | + |
| 192 | +- 从这里开始: |
| 193 | + - [文档中心(所有页面链接)](/start/hubs) |
| 194 | + - [帮助](/help) ← _常见修复方案 + 故障排除_ |
| 195 | + - [配置](/gateway/configuration) |
| 196 | + - [配置示例](/gateway/configuration-examples) |
| 197 | + - [斜杠命令](/tools/slash-commands) |
| 198 | + - [多智能体路由](/concepts/multi-agent) |
| 199 | + - [更新 / 回滚](/install/updating) |
| 200 | + - [配对(私聊 + 节点)](/start/pairing) |
| 201 | + - [Nix 模式](/install/nix) |
| 202 | + - [OpenClaw 助手设置](/start/openclaw) |
| 203 | + - [技能](/tools/skills) |
| 204 | + - [技能配置](/tools/skills-config) |
| 205 | + - [工作区模板](/reference/templates/AGENTS) |
| 206 | + - [RPC 适配器](/reference/rpc) |
| 207 | + - [Gateway 运维手册](/gateway) |
| 208 | + - [节点(iOS/Android)](/nodes) |
| 209 | + - [Web 界面(控制界面)](/web) |
| 210 | + - [发现机制 + 传输方式](/gateway/discovery) |
| 211 | + - [远程访问](/gateway/remote) |
| 212 | +- 提供商与用户体验: |
| 213 | + - [网页聊天](/web/webchat) |
| 214 | + - [控制界面(浏览器)](/web/control-ui) |
| 215 | + - [Telegram](/channels/telegram) |
| 216 | + - [Discord](/channels/discord) |
| 217 | + - [Mattermost(插件)](/channels/mattermost) |
| 218 | + - [iMessage](/channels/imessage) |
| 219 | + - [群组](/concepts/groups) |
| 220 | + - [WhatsApp 群组消息](/concepts/group-messages) |
| 221 | + - [媒体:图片](/nodes/images) |
| 222 | + - [媒体:音频](/nodes/audio) |
| 223 | +- 伴侣应用: |
| 224 | + - [macOS 应用](/platforms/macos) |
| 225 | + - [iOS 应用](/platforms/ios) |
| 226 | + - [Android 应用](/platforms/android) |
| 227 | + - [Windows (WSL2)](/platforms/windows) |
| 228 | + - [Linux 应用](/platforms/linux) |
| 229 | +- 运维与安全: |
| 230 | + - [会话](/concepts/session) |
| 231 | + - [定时任务](/automation/cron-jobs) |
| 232 | + - [Webhooks](/automation/webhook) |
| 233 | + - [Gmail 钩子(Pub/Sub)](/automation/gmail-pubsub) |
| 234 | + - [安全](/gateway/security) |
| 235 | + - [故障排除](/gateway/troubleshooting) |
| 236 | + |
| 237 | +## 名称由来 |
| 238 | + |
| 239 | +**OpenClaw = CLAW + TARDIS** — 因为每只太空龙虾都需要一台时空机器。 |
| 240 | + |
| 241 | +--- |
| 242 | + |
| 243 | +_"我们都只是在玩弄自己的提示词罢了。"_ — 大概是一个嗑多了 token 的 AI 说的 |
| 244 | + |
| 245 | +## 致谢 |
| 246 | + |
| 247 | +- **Peter Steinberger** ([@steipete](https://twitter.com/steipete))— 创作者,龙虾低语者 |
| 248 | +- **Mario Zechner** ([@badlogicc](https://twitter.com/badlogicgames))— Pi 创作者,安全渗透测试员 |
| 249 | +- **Clawd** — 那只要求取个更好名字的太空龙虾 |
| 250 | + |
| 251 | +## 核心贡献者 |
| 252 | + |
| 253 | +- **Maxim Vovshin ** ( @Hyaxia, [email protected])— Blogwatcher 技能 |
| 254 | +- **Nacho Iacovino ** ( @nachoiacovino, [email protected])— 位置解析(Telegram + WhatsApp) |
| 255 | + |
| 256 | +## 许可证 |
| 257 | + |
| 258 | +MIT — 像大海中的龙虾一样自由 🦞 |
| 259 | + |
| 260 | +--- |
| 261 | + |
| 262 | +_"我们都只是在玩弄自己的提示词罢了。"_ — 大概是一个嗑多了 token 的 AI 说的 |
0 commit comments