针对真实环境部署的快速回答和更深入的故障排查(本地开发、VPS、多智能体、OAuth/API 密钥、模型故障切换)。运行时诊断请参见 故障排查。完整配置参考请参见 配置。Documentation Index
Fetch the complete documentation index at: https://openclaw.zhcndoc.com/llms.txt
Use this file to discover all available pages before exploring further.
出问题后的前 60 秒
-
快速状态(先检查这个)
本地快速摘要:操作系统 + 更新、网关/服务可达性、智能体/会话、提供商配置 + 运行时问题(当网关可达时)。
-
可直接粘贴的报告(可安全分享)
只读诊断,带日志尾部内容(令牌已脱敏)。
-
守护进程 + 端口状态
显示 supervisor 运行状态与 RPC 可达性的区别、探测目标 URL,以及服务可能使用了哪个配置。
-
深度探测
运行实时网关健康探测,包括在支持时的通道探测 (需要网关可达)。参见 健康。
-
跟踪最新日志
如果 RPC 不可用,改用:文件日志与服务日志是分开的;参见 日志 和 故障排查。
-
运行 doctor(修复)
修复/迁移配置与状态 + 运行健康检查。参见 Doctor。
-
网关快照
向正在运行的网关请求完整快照(仅 WS)。参见 健康。
快速开始与首次运行设置
首次运行问答——安装、上手、认证流程、订阅、初始失败—— 都在 首次运行 FAQ。什么是 OpenClaw?
用一句话说,OpenClaw 是什么?
用一句话说,OpenClaw 是什么?
价值主张
价值主张
- 你的设备,你的数据: 在你想要的地方运行 Gateway(Mac、Linux、VPS),并将 工作区 + 会话历史保留在本地。
- 真实通道,而不是网页沙盒: WhatsApp/Telegram/Slack/Discord/Signal/iMessage 等, 以及受支持平台上的移动语音和 Canvas。
- 模型无关: 可使用 Anthropic、OpenAI、MiniMax、OpenRouter 等,并支持按智能体路由 和故障切换。
- 仅本地选项: 运行本地模型,这样如果你愿意,所有数据都可以保留在你的设备上。
- 多智能体路由: 按频道、账号或任务拆分智能体,每个都有自己的 工作区和默认设置。
- 开源且可改造: 可审查、扩展并自行托管,没有供应商锁定。
我刚刚设置好——接下来该做什么?
我刚刚设置好——接下来该做什么?
- 搭建网站(WordPress、Shopify 或一个简单的静态站点)。
- 原型一个移动应用(梳理需求、界面、API 方案)。
- 整理文件和文件夹(清理、命名、标记)。
- 连接 Gmail 并自动生成摘要或后续跟进。
OpenClaw 的五个最常见日常用途是什么?
OpenClaw 的五个最常见日常用途是什么?
- 个人简报: 对你关心的收件箱、日历和新闻进行摘要。
- 研究与起草: 快速研究、摘要,以及给邮件或文档写第一版草稿。
- 提醒与跟进: 由 cron 或心跳驱动的提醒和检查清单。
- 浏览器自动化: 填写表单、收集数据、重复性的网页任务。
- 跨设备协同: 从手机发出任务,让 Gateway 在服务器上运行它,然后把结果发回聊天里。
OpenClaw 能帮助 SaaS 的获客、外联、广告和博客吗?
OpenClaw 能帮助 SaaS 的获客、外联、广告和博客吗?
与 Claude Code 相比,它在网页开发方面有哪些优势?
与 Claude Code 相比,它在网页开发方面有哪些优势?
- 持久记忆 + 工作区,跨会话保留
- 多平台访问(WhatsApp、Telegram、TUI、WebChat)
- 工具编排(浏览器、文件、调度、钩子)
- 始终在线的 Gateway(可运行在 VPS 上,随时从任何地方交互)
- 节点 用于本地浏览器/屏幕/摄像头/执行
技能与自动化
如何自定义技能而又不让仓库变脏?
如何自定义技能而又不让仓库变脏?
~/.openclaw/skills/<name>/SKILL.md 中(或者通过 ~/.openclaw/openclaw.json 里的 skills.load.extraDirs 添加一个文件夹)。优先级是 <workspace>/skills → <workspace>/.agents/skills → ~/.agents/skills → ~/.openclaw/skills → 内置 → skills.load.extraDirs,因此受管理的覆盖层仍然会覆盖内置技能,而不会触碰 git。如果你需要把技能全局安装,但只对某些智能体可见,就把共享副本放在 ~/.openclaw/skills 中,并通过 agents.defaults.skills 和 agents.list[].skills 控制可见性。只有值得上游合并的修改才应该留在仓库里并以 PR 形式提交。我可以从自定义文件夹加载技能吗?
我可以从自定义文件夹加载技能吗?
~/.openclaw/openclaw.json 中的 skills.load.extraDirs 添加额外目录(最低优先级)。默认优先级是 <workspace>/skills → <workspace>/.agents/skills → ~/.agents/skills → ~/.openclaw/skills → 内置 → skills.load.extraDirs。clawhub 默认安装到 ./skills,而 OpenClaw 会在下一次会话中将其视为 <workspace>/skills。如果某个技能只应对特定智能体可见,就把它与 agents.defaults.skills 或 agents.list[].skills 配合使用。如何针对不同任务使用不同模型?
如何针对不同任务使用不同模型?
机器人在执行重任务时卡住了。如何把它卸载出去?
机器人在执行重任务时卡住了。如何把它卸载出去?
Discord 上按线程绑定的子智能体会话是如何工作的?
Discord 上按线程绑定的子智能体会话是如何工作的?
- 使用
sessions_spawn并设置thread: true(也可以选择mode: "session"以便持续跟进)。 - 或者手动使用
/focus <target>绑定。 - 使用
/agents检查绑定状态。 - 使用
/session idle <duration|off>和/session max-age <duration|off>控制自动取消聚焦。 - 使用
/unfocus解除线程绑定。
- Global defaults:
session.threadBindings.enabled,session.threadBindings.idleHours,session.threadBindings.maxAgeHours. - Discord overrides:
channels.discord.threadBindings.enabled,channels.discord.threadBindings.idleHours,channels.discord.threadBindings.maxAgeHours. - Auto-bind on spawn:
channels.discord.threadBindings.spawnSessionsdefaults totrue; set it tofalseto disable thread-bound session spawns.
子智能体完成了,但完成更新发到了错误的位置,或者根本没发出去。我该检查什么?
子智能体完成了,但完成更新发到了错误的位置,或者根本没发出去。我该检查什么?
- 完成模式的子智能体交付会优先使用任何已绑定的线程或会话路由(如果存在)。
- 如果完成来源只携带了一个频道,OpenClaw 会回退到请求方会话保存的路由(
lastChannel/lastTo/lastAccountId),这样直接投递仍然可能成功。 - 如果既没有绑定路由,也没有可用的已保存路由,直接投递可能失败,结果会回退为排队的会话投递,而不是立即发到聊天里。
- 无效或过期的目标仍然可能强制回退到队列,或导致最终投递失败。
- 如果子进程最后一次可见的助手回复是精确的静默令牌
NO_REPLY/no_reply,或者正好是ANNOUNCE_SKIP,OpenClaw 会有意抑制公告,而不是发布过时的早期进度。 - 如果子进程在仅有工具调用后超时,公告可以把它折叠成一段简短的部分进度摘要,而不是重放原始工具输出。
Cron 或提醒没有触发。我该检查什么?
Cron 或提醒没有触发。我该检查什么?
Cron 已触发,但没有内容发送到频道。为什么?
Cron 已触发,但没有内容发送到频道。为什么?
--no-deliver/delivery.mode: "none"表示不应期望 runner 回退发送。- 缺少或无效的公告目标(
channel/to)意味着 runner 跳过了外发投递。 - 频道认证失败(
unauthorized、Forbidden)意味着 runner 尝试投递了,但凭据阻止了它。 - 静默的隔离结果(仅
NO_REPLY/no_reply)会被视为有意不可投递,因此 runner 也会抑制排队回退投递。
message
工具直接发送。--announce 只控制 runner 对于智能体尚未发送的最终文本的
回退路径。调试:为什么一个隔离的 cron 运行会切换模型或重试一次?
为什么一个隔离的 cron 运行会切换模型或重试一次?
LiveSessionModelSwitchError 时,持久化一个运行时模型接管并进行重试。重试会保留切换后的
提供商/模型;如果切换带来了新的 auth profile 覆盖,cron
也会在重试前持久化它。相关选择规则:- 适用时,Gmail 钩子的模型覆盖优先。
- 然后是每个任务的
model。 - 然后是任何已保存的 cron 会话模型覆盖。
- 然后才是正常的智能体/默认模型选择。
我如何在 Linux 上安装技能?
我如何在 Linux 上安装技能?
openclaw skills 命令,或者把技能直接放进你的工作区。macOS 的 Skills UI 在 Linux 上不可用。
在 https://clawhub.ai 浏览技能。openclaw skills install 会写入当前工作区的 skills/
目录。仅当你想发布或同步自己的技能时,才安装单独的 clawhub CLI。
对于跨代理共享安装,把技能放在 ~/.openclaw/skills 下,如果你想缩小哪些代理可见,
可使用 agents.defaults.skills 或
agents.list[].skills。Can OpenClaw run tasks on a schedule or continuously in the background?
Can OpenClaw run tasks on a schedule or continuously in the background?
- Cron jobs 用于定时或重复任务(重启后仍会保留)。
- Heartbeat 用于“主会话”的周期性检查。
- Isolated jobs 用于自主代理,向聊天中发送摘要或投递内容。
Can I run Apple macOS-only skills from Linux?
Can I run Apple macOS-only skills from Linux?
metadata.openclaw.os 和所需二进制文件限制,并且只有当它们在 Gateway 主机 上符合条件时,技能才会出现在系统提示词中。在 Linux 上,只有 darwin 的技能(如 apple-notes、apple-reminders、things-mac)不会加载,除非你覆盖该限制。你有三种受支持的模式:选项 A - 在 Mac 上运行 Gateway(最简单)。
将 Gateway 运行在存在 macOS 二进制文件的地方,然后从 Linux 通过 远程模式 或 Tailscale 连接。由于 Gateway 主机是 macOS,技能会正常加载。选项 B - 使用 macOS 节点(无需 SSH)。
在 Linux 上运行 Gateway,配对一个 macOS 节点(菜单栏应用),并将 Mac 上的 Node Run Commands 设为“Always Ask”或“Always Allow”。当所需二进制文件存在于该节点时,OpenClaw 可以将 macOS 专属技能视为可用。代理通过 nodes 工具运行这些技能。如果你选择“Always Ask”,在提示中批准“Always Allow”会把该命令加入允许列表。选项 C - 通过 SSH 代理 macOS 二进制文件(高级)。
保持 Gateway 运行在 Linux 上,但让所需的 CLI 二进制文件解析为在 Mac 上运行的 SSH 包装器。然后覆盖该技能以允许 Linux,使其保持可用。-
为该二进制文件创建 SSH 包装器(示例:Apple Notes 的
memo): -
将包装器放到 Linux 主机的
PATH中(例如~/bin/memo)。 -
覆盖技能元数据(工作区或
~/.openclaw/skills)以允许 Linux: - 开启新的会话,让技能快照刷新。
Do you have a Notion or HeyGen integration?
Do you have a Notion or HeyGen integration?
- 自定义技能 / 插件: 最适合可靠的 API 访问(Notion/HeyGen 都有 API)。
- 浏览器自动化: 无需代码即可使用,但更慢也更脆弱。
- 每个客户一个 Notion 页面(上下文 + 偏好 + 当前工作)。
- 让代理在会话开始时先抓取该页面。
skills/ 目录。对于跨代理共享技能,把它们放在 ~/.openclaw/skills/<name>/SKILL.md。如果只希望某些代理看到某个共享安装,请配置 agents.defaults.skills 或 agents.list[].skills。某些技能依赖通过 Homebrew 安装的二进制文件;在 Linux 上这意味着使用 Linuxbrew(参见上面的 Homebrew Linux FAQ 条目)。另见 Skills、Skills config 和 ClawHub。How do I use my existing signed-in Chrome with OpenClaw?
How do I use my existing signed-in Chrome with OpenClaw?
user 浏览器配置文件,它通过 Chrome DevTools MCP 连接:existing-session / user 的当前限制:- 操作是基于 ref 的,而不是基于 CSS selector 的
- 上传需要
ref/inputRef,并且当前一次只支持一个文件 responsebody、PDF 导出、下载拦截以及批量操作仍需要受管浏览器或原始 CDP 配置文件
沙箱和内存
Is there a dedicated sandboxing doc?
Is there a dedicated sandboxing doc?
Docker feels limited - how do I enable full features?
Docker feels limited - how do I enable full features?
node 用户,因此不包含
系统包、Homebrew 或捆绑浏览器。若要更完整的设置:- 使用
OPENCLAW_HOME_VOLUME持久化/home/node,以便缓存得以保留。 - 使用
OPENCLAW_DOCKER_APT_PACKAGES将系统依赖烘焙进镜像。 - 通过捆绑的 CLI 安装 Playwright 浏览器:
node /app/node_modules/playwright-core/cli.js install chromium - 设置
PLAYWRIGHT_BROWSERS_PATH并确保该路径被持久化。
Can I keep DMs personal but make groups public/sandboxed with one agent?
Can I keep DMs personal but make groups public/sandboxed with one agent?
agents.defaults.sandbox.mode: "non-main",这样群组/频道会话(非主键)会在配置的沙箱后端中运行,而主 DM 会话则保持在主机上。如果你不选择其他后端,Docker 是默认后端。然后通过 tools.sandbox.tools 限制沙箱会话中可用的工具。设置流程 + 示例配置:Groups: personal DMs + public groups关键配置参考:Gateway configurationHow do I bind a host folder into the sandbox?
How do I bind a host folder into the sandbox?
agents.defaults.sandbox.docker.binds 设为 ["host:path:mode"](例如 "/home/user/src:/src:ro")。全局 + 每个代理的 bind 会合并;当 scope: "shared" 时,每个代理的 bind 会被忽略。对任何敏感内容请使用 :ro,并记住 bind 会绕过沙箱文件系统边界。OpenClaw 会通过规范化路径以及通过最深的现有祖先解析得到的规范路径来验证 bind 源。这意味着即使最后一个路径段尚不存在,符号链接父级逃逸也会以失败关闭的方式被阻止,并且在符号链接解析后仍会应用允许根目录检查。参见 Sandboxing 和 Sandbox vs Tool Policy vs Elevated 获取示例和安全说明。How does memory work?
How does memory work?
memory/YYYY-MM-DD.md中的每日笔记MEMORY.md中整理后的长期笔记(仅主/私有会话)
Memory keeps forgetting things. How do I make it stick?
Memory keeps forgetting things. How do I make it stick?
MEMORY.md,
短期上下文放到 memory/YYYY-MM-DD.md。这仍是我们正在改进的领域。提醒模型存储记忆会有帮助;
它会知道该怎么做。如果它总是忘记,检查 Gateway 是否每次运行都使用相同的
工作区。文档:Memory, Agent workspace。Does memory persist forever? What are the limits?
Does memory persist forever? What are the limits?
Does semantic memory search require an OpenAI API key?
Does semantic memory search require an OpenAI API key?
OPENAI_API_KEY 或 models.providers.openai.apiKey)。如果你没有显式设置 provider,OpenClaw 会在能够解析出 API key 时自动选择 provider
(auth profiles、models.providers.*.apiKey 或环境变量)。如果能解析到 OpenAI key,
它会优先选择 OpenAI;否则如果能解析到 Gemini key,则选择 Gemini,然后是 Voyage,再然后是 Mistral。
如果没有可用的远程 key,memory 搜索会保持禁用,直到你进行配置。如果你配置并提供了本地模型路径,
OpenClaw 会优先选择 local。当你显式设置
memorySearch.provider = "ollama" 时,也支持 Ollama。如果你想完全保持本地,设置 memorySearch.provider = "local"(并可选
memorySearch.fallback = "none")。如果你想使用 Gemini embeddings,设置
memorySearch.provider = "gemini" 并提供 GEMINI_API_KEY(或
memorySearch.remote.apiKey)。我们支持 OpenAI、Gemini、Voyage、Mistral、Ollama 或本地 embedding
模型——设置细节参见 Memory。磁盘上的内容位置
Is all data used with OpenClaw saved locally?
Is all data used with OpenClaw saved locally?
- 默认本地: 会话、memory 文件、配置和工作区都保存在 Gateway 主机上
(
~/.openclaw+ 你的工作区目录)。 - 出于必要而远程: 你发送给模型提供商(Anthropic/OpenAI 等)的消息会进入 它们的 API,而聊天平台(WhatsApp/Telegram/Slack 等)会把消息数据存储在它们自己的 服务器上。
- 由你控制可见范围: 使用本地模型可让提示词留在你的机器上,但频道 流量仍然会经过频道服务器。
Where does OpenClaw store its data?
Where does OpenClaw store its data?
$OPENCLAW_STATE_DIR 下(默认:~/.openclaw):| Path | Purpose |
|---|---|
$OPENCLAW_STATE_DIR/openclaw.json | 主要配置(JSON5) |
$OPENCLAW_STATE_DIR/credentials/oauth.json | 旧版 OAuth 导入(首次使用时复制到 auth profiles) |
$OPENCLAW_STATE_DIR/agents/<agentId>/agent/auth-profiles.json | 认证配置文件(OAuth、API keys,以及可选的 keyRef/tokenRef) |
$OPENCLAW_STATE_DIR/secrets.json | 可选的基于文件的 secret 负载,供 file SecretRef 提供者使用 |
$OPENCLAW_STATE_DIR/agents/<agentId>/agent/auth.json | 旧版兼容文件(静态 api_key 条目会被清理) |
$OPENCLAW_STATE_DIR/credentials/ | 提供方状态(例如 whatsapp/<accountId>/creds.json) |
$OPENCLAW_STATE_DIR/agents/ | 每个代理的状态(agentDir + sessions) |
$OPENCLAW_STATE_DIR/agents/<agentId>/sessions/ | 对话历史和状态(每个代理) |
$OPENCLAW_STATE_DIR/agents/<agentId>/sessions/sessions.json | 会话元数据(每个代理) |
~/.openclaw/agent/*(由 openclaw doctor 迁移)。你的 workspace(AGENTS.md、memory 文件、skills 等)是独立的,通过 agents.defaults.workspace 配置(默认:~/.openclaw/workspace)。Where should AGENTS.md / SOUL.md / USER.md / MEMORY.md live?
Where should AGENTS.md / SOUL.md / USER.md / MEMORY.md live?
~/.openclaw。- Workspace(每个代理):
AGENTS.md、SOUL.md、IDENTITY.md、USER.md、MEMORY.md、memory/YYYY-MM-DD.md、可选的HEARTBEAT.md。 根目录小写的memory.md仅作为旧版修复输入;当两个文件都存在时,openclaw doctor --fix可以把它合并到MEMORY.md中。 - State dir(
~/.openclaw):配置、频道/提供方状态、认证配置文件、会话、日志, 以及共享技能(~/.openclaw/skills)。
~/.openclaw/workspace,可通过以下方式配置:Recommended backup strategy
Recommended backup strategy
~/.openclaw 下的任何内容(凭据、会话、令牌或加密的 secret 负载)。
如果你需要完整恢复,请分别备份工作区和状态目录
(参见上面的迁移问题)。文档:Agent workspace。How do I completely uninstall OpenClaw?
How do I completely uninstall OpenClaw?
Can agents work outside the workspace?
Can agents work outside the workspace?
agents.defaults.sandbox 或每个代理的沙箱设置。如果你
想让某个仓库成为默认工作目录,可以把该代理的 workspace
指向仓库根目录。OpenClaw 仓库只是源代码;除非你有意让代理在其中工作,
否则请保持 workspace 独立。示例(将仓库作为默认 cwd):Remote mode: where is the session store?
Remote mode: where is the session store?
配置基础
What format is the config? Where is it?
What format is the config? Where is it?
$OPENCLAW_CONFIG_PATH 读取一个可选的 JSON5 配置(默认:~/.openclaw/openclaw.json):~/.openclaw/workspace)。I set gateway.bind: "lan" (or "tailnet") and now nothing listens / the UI says unauthorized
I set gateway.bind: "lan" (or "tailnet") and now nothing listens / the UI says unauthorized
Why do I need a token on localhost now?
Why do I need a token on localhost now?
gateway.auth.token,因此本地 WS 客户端必须认证。这会阻止其他本地进程调用 Gateway。如果你更喜欢其他认证路径,可以显式选择 password 模式(或者对于具备身份感知的反向代理,选择 trusted-proxy)。如果你真的想开放回环访问,请在配置中显式设置 gateway.auth.mode: "none"。你随时可以让 doctor 帮你生成 token:openclaw doctor --generate-gateway-token。Do I have to restart after changing config?
Do I have to restart after changing config?
gateway.reload.mode: "hybrid"(默认):安全变更热应用,关键变更重启- 也支持
hot、restart、off
How do I disable funny CLI taglines?
How do I disable funny CLI taglines?
cli.banner.taglineMode:off:隐藏标语文本,但保留横幅标题/版本行。default:每次都使用All your chats, one OpenClaw.。random:轮换有趣/季节性标语(默认行为)。- 如果你想完全不显示 banner,可以设置环境变量
OPENCLAW_HIDE_BANNER=1。
How do I enable web search (and web fetch)?
How do I enable web search (and web fetch)?
web_fetch 无需 API key 即可使用。web_search 取决于你选择的
provider:- 基于 API 的 provider,如 Brave、Exa、Firecrawl、Gemini、Grok、Kimi、MiniMax Search、Perplexity 和 Tavily,需要按常规设置它们的 API key。
- Ollama Web Search 不需要 key,但它使用你配置的 Ollama 主机并需要
ollama signin。 - DuckDuckGo 不需要 key,但它是一个非官方的基于 HTML 的集成。
- SearXNG 不需要 key/可自托管;请配置
SEARXNG_BASE_URL或plugins.entries.searxng.config.webSearch.baseUrl。
openclaw configure --section web 并选择一个 provider。
环境变量替代项:- Brave:
BRAVE_API_KEY - Exa:
EXA_API_KEY - Firecrawl:
FIRECRAWL_API_KEY - Gemini:
GEMINI_API_KEY - Grok:
XAI_API_KEY - Kimi:
KIMI_API_KEY或MOONSHOT_API_KEY - MiniMax Search:
MINIMAX_CODE_PLAN_KEY,MINIMAX_CODING_API_KEY, 或MINIMAX_API_KEY - Perplexity:
PERPLEXITY_API_KEY或OPENROUTER_API_KEY - SearXNG:
SEARXNG_BASE_URL - Tavily:
TAVILY_API_KEY
plugins.entries.<plugin>.config.webSearch.*。
为兼容性保留的旧 tools.web.search.* provider 路径仍会临时加载,但新配置不应再使用它们。
Firecrawl web-fetch 回退配置位于 plugins.entries.firecrawl.config.webFetch.*。注意:- 如果你使用 allowlist,请添加
web_search/web_fetch/x_search或group:web。 web_fetch默认启用(除非显式禁用)。- 如果省略
tools.web.fetch.provider,OpenClaw 会从可用凭据中自动检测第一个可用的 fetch 回退 provider。当前捆绑的 provider 是 Firecrawl。 - 守护进程会从
~/.openclaw/.env(或服务环境)读取环境变量。
config.apply wiped my config. How do I recover and avoid this?
config.apply wiped my config. How do I recover and avoid this?
config.apply 会替换整个配置。如果你发送的是部分对象,其余内容都会被移除。当前 OpenClaw 已保护许多误删情况:- OpenClaw-owned config writes validate the full post-change config before writing.
- Invalid or destructive OpenClaw-owned writes are rejected and saved as
openclaw.json.rejected.*. - If a direct edit breaks startup or hot reload, Gateway fails closed or skips the reload; it does not rewrite
openclaw.json. openclaw doctor --fixowns repair and can restore last-known-good while saving the rejected file asopenclaw.json.clobbered.*.
- Check
openclaw logs --followforInvalid config at,Config write rejected:, orconfig reload skipped (invalid config). - Inspect the newest
openclaw.json.clobbered.*oropenclaw.json.rejected.*beside the active config. - Run
openclaw config validateandopenclaw doctor --fix. - Copy only the intended keys back with
openclaw config setorconfig.patch. - If you have no last-known-good or rejected payload, restore from backup, or re-run
openclaw doctorand reconfigure channels/models. - If this was unexpected, file a bug and include your last known config or any backup.
- A local coding agent can often reconstruct a working config from logs or history.
- 小改动请使用
openclaw config set。 - 交互式编辑请使用
openclaw configure。 - 不确定精确路径或字段结构时,先用
config.schema.lookup;它会返回一个浅层 schema 节点以及立即的子项摘要,方便继续深入。 - 部分 RPC 编辑请使用
config.patch;仅在需要完整配置替换时才用config.apply。 - 如果你在代理运行中使用仅 owner 可用的
gateway工具,它仍会拒绝写入tools.exec.ask/tools.exec.security(包括归一化到相同受保护 exec 路径的旧tools.bash.*别名)。
How do I run a central Gateway with specialized workers across devices?
How do I run a central Gateway with specialized workers across devices?
- Gateway(中心): 负责 channels(Signal/WhatsApp)、路由和会话。
- Nodes(设备): Mac/iOS/Android 作为外围设备连接,并暴露本地工具(
system.run、canvas、camera)。 - Agents(worker): 为特殊角色提供独立的大脑/工作区(例如“Hetzner 运维”、“个人数据”)。
- Sub-agents: 当你需要并行时,从主代理中生成后台工作。
- TUI: 连接到 Gateway 并切换代理/会话。
Can the OpenClaw browser run headless?
Can the OpenClaw browser run headless?
false(有界面模式)。无头模式在某些网站上更容易触发反机器人检查。参见 Browser。无头模式使用相同的 Chromium 引擎,对大多数自动化(表单、点击、抓取、登录)都有效。主要区别:- 没有可见的浏览器窗口(如果你需要可视化,请使用截图)。
- 某些网站对无头模式下的自动化限制更严格(CAPTCHA、反机器人)。 例如,X/Twitter 经常会阻止无头会话。
How do I use Brave for browser control?
How do I use Brave for browser control?
browser.executablePath 设为你的 Brave 二进制文件(或任何基于 Chromium 的浏览器),并重启 Gateway。
详见 Browser 中的完整配置示例。远程 gateway 和节点
How do commands propagate between Telegram, the gateway, and nodes?
How do commands propagate between Telegram, the gateway, and nodes?
node.* → Node → Gateway → TelegramNodes 不会看到入站 provider 流量;它们只接收 node RPC 调用。How can my agent access my computer if the Gateway is hosted remotely?
How can my agent access my computer if the Gateway is hosted remotely?
node.* 工具(屏幕、摄像头、系统)。典型设置:- 在始终在线的主机(VPS/家用服务器)上运行 Gateway。
- 将 Gateway 主机和你的电脑放在同一个 tailnet 中。
- 确保 Gateway WS 可达(tailnet bind 或 SSH 隧道)。
- 在本地打开 macOS 应用,并以 Remote over SSH 模式(或直接 tailnet) 连接,使其可以注册为一个 node。
-
在 Gateway 上批准该 node:
system.run。只
配对你信任的设备,并查看 Security。文档:Nodes, Gateway protocol, macOS remote mode, Security。Tailscale is connected but I get no replies. What now?
Tailscale is connected but I get no replies. What now?
- Gateway 正在运行:
openclaw gateway status - Gateway 健康状态:
openclaw status - Channel 健康状态:
openclaw channels status
- 如果你使用 Tailscale Serve,确保
gateway.auth.allowTailscale设置正确。 - 如果你通过 SSH 隧道连接,确认本地隧道已建立且指向正确端口。
- 确认你的 allowlist(DM 或 group)包含你的账号。
Can two OpenClaw instances talk to each other (local + VPS)?
Can two OpenClaw instances talk to each other (local + VPS)?
openclaw agent --message ... --deliver 调用另一个 Gateway,目标是一个
另一个机器人监听的聊天。若其中一个机器人在远程 VPS 上,则通过 SSH/Tailscale
将 CLI 指向该远程 Gateway(参见 Remote access)。示例模式(从能连接目标 Gateway 的机器上运行):Do I need separate VPSes for multiple agents?
Do I need separate VPSes for multiple agents?
Is there a benefit to using a node on my personal laptop instead of SSH from a VPS?
Is there a benefit to using a node on my personal laptop instead of SSH from a VPS?
- 不需要入站 SSH。 nodes 通过 Gateway WebSocket 外连,并使用设备配对。
- 更安全的执行控制。
system.run会在该笔记本上受到 node allowlist/审批的限制。 - 更多设备工具。 nodes 除了
system.run之外,还暴露canvas、camera和screen。 - 本地浏览器自动化。 保持 Gateway 在 VPS 上运行,但通过笔记本上的 node host 本地运行 Chrome,或通过 Chrome MCP 连接到主机上的本地 Chrome。
Do nodes run a gateway service?
Do nodes run a gateway service?
gateway、discovery 和 canvasHost 的更改需要完全重启。Is there an API / RPC way to apply config?
Is there an API / RPC way to apply config?
config.schema.lookup:在写入前检查一个配置子树及其浅层 schema 节点、匹配的 UI 提示和直接子项摘要config.get:获取当前快照 + hashconfig.patch:安全的部分更新(大多数 RPC 编辑首选);尽可能热重载,需要时重启config.apply:验证并替换完整配置;尽可能热重载,需要时重启- 仅 owner 可用的
gateway运行时工具仍会拒绝重写tools.exec.ask/tools.exec.security;旧的tools.bash.*别名会归一化到同样受保护的 exec 路径
Minimal sane config for a first install
Minimal sane config for a first install
How do I set up Tailscale on a VPS and connect from my Mac?
How do I set up Tailscale on a VPS and connect from my Mac?
-
在 VPS 上安装 + 登录
-
在你的 Mac 上安装 + 登录
- 使用 Tailscale 应用并登录到同一个 tailnet。
-
启用 MagicDNS(推荐)
- 在 Tailscale 管理控制台中启用 MagicDNS,这样 VPS 会有稳定名称。
-
使用 tailnet 主机名
- SSH:
ssh user@your-vps.tailnet-xxxx.ts.net - Gateway WS:
ws://your-vps.tailnet-xxxx.ts.net:18789
- SSH:
How do I connect a Mac node to a remote Gateway (Tailscale Serve)?
How do I connect a Mac node to a remote Gateway (Tailscale Serve)?
- 确保 VPS + Mac 在同一个 tailnet 上。
- 在 Remote 模式下使用 macOS 应用(SSH 目标可以是 tailnet 主机名)。 应用会隧道转发 Gateway 端口并作为 node 连接。
-
在 gateway 上批准 node:
Should I install on a second laptop or just add a node?
Should I install on a second laptop or just add a node?
环境变量和 .env 加载
How does OpenClaw load environment variables?
How does OpenClaw load environment variables?
- 当前工作目录下的
.env ~/.openclaw/.env(即$OPENCLAW_STATE_DIR/.env)中的全局后备.env
.env 文件都不会覆盖已存在的环境变量。你也可以在配置中定义内联环境变量(仅在进程环境中缺失时应用):I started the Gateway via the service and my env vars disappeared. What now?
I started the Gateway via the service and my env vars disappeared. What now?
- 把缺失的键放到
~/.openclaw/.env中,这样即使服务没有继承你的 shell 环境,它们也会被加载。 - 启用 shell 导入(可选便利功能):
OPENCLAW_LOAD_SHELL_ENV=1, OPENCLAW_SHELL_ENV_TIMEOUT_MS=15000。I set COPILOT_GITHUB_TOKEN, but models status shows "Shell env: off." Why?
I set COPILOT_GITHUB_TOKEN, but models status shows "Shell env: off." Why?
openclaw models status 报告的是shell 环境导入是否启用。“Shell env: off”
并 不 表示你的环境变量缺失——它只是表示 OpenClaw 不会自动加载
你的登录 shell。如果 Gateway 作为服务(launchd/systemd)运行,它不会继承你的 shell
环境。请通过以下任一方式修复:-
将 token 放入
~/.openclaw/.env: -
或启用 shell 导入(
env.shellEnv.enabled: true)。 -
或把它加入配置中的
env区块(仅在缺失时生效)。
COPILOT_GITHUB_TOKEN 读取(也支持 GH_TOKEN / GITHUB_TOKEN)。
参见 /concepts/model-providers 和 /environment。会话和多个聊天
How do I start a fresh conversation?
How do I start a fresh conversation?
/new 或 /reset 作为独立消息。参见 Session management。Do sessions reset automatically if I never send /new?
Do sessions reset automatically if I never send /new?
session.idleMinutes 后过期,但这默认禁用(默认值 0)。
将其设为正值即可启用空闲过期。启用后,空闲期之后的下一条
消息会为该 chat key 开启一个新的会话 id。
这不会删除转录——它只是开始一个新会话。Is there a way to make a team of OpenClaw instances (one CEO and many agents)?
Is there a way to make a team of OpenClaw instances (one CEO and many agents)?
Why did context get truncated mid-task? How do I prevent it?
Why did context get truncated mid-task? How do I prevent it?
- 让机器人总结当前状态并写入文件。
- 在长任务前使用
/compact,切换话题时使用/new。 - 把重要上下文保存在工作区中,并让机器人把它读回来。
- 对长时间或并行工作使用 sub-agents,让主聊天保持更小。
- 如果这经常发生,选择上下文窗口更大的模型。
How do I completely reset OpenClaw but keep it installed?
How do I completely reset OpenClaw but keep it installed?
- Onboarding 在检测到现有配置时也会提供 Reset。参见 Onboarding (CLI)。
- 如果你使用了 profiles(
--profile/OPENCLAW_PROFILE),请为每个 state dir 单独重置(默认是~/.openclaw-<profile>)。 - 开发重置:
openclaw gateway --dev --reset(仅开发可用;会清除开发配置 + 凭据 + 会话 + 工作区)。
I am getting "context too large" errors - how do I reset or compact?
I am getting "context too large" errors - how do I reset or compact?
-
Compact(保留对话,但总结更早的轮次):
或使用
/compact <instructions>来引导摘要。 -
Reset(为同一个 chat key 开启新的会话 id):
- 启用或调整 session pruning(
agents.defaults.contextPruning)以裁剪旧的工具输出。 - 使用上下文窗口更大的模型。
Why am I seeing "LLM request rejected: messages.content.tool_use.input field required"?
Why am I seeing "LLM request rejected: messages.content.tool_use.input field required"?
tool_use 块,但缺少必需的
input。这通常意味着会话历史过旧或损坏(通常发生在长线程之后
或工具/schema 变更之后)。修复:使用 /new(独立消息)开启一个新会话。Why am I getting heartbeat messages every 30 minutes?
Why am I getting heartbeat messages every 30 minutes?
HEARTBEAT.md 存在但实际上是空的(只有空行和像 # Heading 这样的 markdown
标题),OpenClaw 会跳过 heartbeat 运行以节省 API 调用。
如果该文件缺失,heartbeat 仍会运行,由模型决定要做什么。每个代理的覆盖项使用 agents.list[].heartbeat。文档:Heartbeat。Do I need to add a "bot account" to a WhatsApp group?
Do I need to add a "bot account" to a WhatsApp group?
groupPolicy: "allowlist")。如果你希望只有你可以触发群组回复:How do I get the JID of a WhatsApp group?
How do I get the JID of a WhatsApp group?
Why does OpenClaw not reply in a group?
Why does OpenClaw not reply in a group?
- 已开启 mention gating(默认)。你必须 @mention 机器人(或匹配
mentionPatterns)。 - 你配置了
channels.whatsapp.groups但没有"*",而该群不在 allowlist 中。
Do groups/threads share context with DMs?
Do groups/threads share context with DMs?
How many workspaces and agents can I create?
How many workspaces and agents can I create?
- 磁盘增长: 会话 + 转录存储在
~/.openclaw/agents/<agentId>/sessions/下。 - Token 成本: 更多代理意味着更多并发模型使用。
- 运维开销: 每个代理的认证配置、工作区和频道路由。
- 每个代理保持一个活跃 workspace(
agents.defaults.workspace)。 - 如果磁盘增长,清理旧会话(删除 JSONL 或 store 条目)。
- 使用
openclaw doctor查找多余的工作区和 profile 不匹配。
Can I run multiple bots or chats at the same time (Slack), and how should I set that up?
Can I run multiple bots or chats at the same time (Slack), and how should I set that up?
- 始终在线的 Gateway 主机(VPS/Mac mini)。
- 每个角色一个代理(绑定)。
- 绑定到这些代理的 Slack channel。
- 需要时通过 Chrome MCP 或 node 使用本地浏览器。
模型、故障转移和认证配置文件
模型问答——默认值、选择、别名、切换、故障转移、认证配置文件—— 位于 Models FAQ。Gateway:端口、“already running”和远程模式
What port does the Gateway use?
What port does the Gateway use?
gateway.port 控制 WebSocket + HTTP(Control UI、hooks 等)使用的单一复用端口。优先级:Why does openclaw gateway status say "Runtime: running" but "Connectivity probe: failed"?
Why does openclaw gateway status say "Runtime: running" but "Connectivity probe: failed"?
openclaw gateway status 并信任这些行:Probe target:(探测实际使用的 URL)Listening:(端口上实际绑定的内容)Last gateway error:(进程活着但端口没在监听时的常见根因)
Why does openclaw gateway status show "Config (cli)" and "Config (service)" different?
Why does openclaw gateway status show "Config (cli)" and "Config (service)" different?
--profile / OPENCLAW_STATE_DIR 不匹配)。修复:--profile / 环境下运行它。What does "another gateway instance is already listening" mean?
What does "another gateway instance is already listening" mean?
ws://127.0.0.1:18789)。如果绑定失败并出现 EADDRINUSE,它会抛出 GatewayLockError,表示已有另一个实例在监听。修复:停止另一个实例、释放端口,或使用 openclaw gateway --port <port> 运行。How do I run OpenClaw in remote mode (client connects to a Gateway elsewhere)?
How do I run OpenClaw in remote mode (client connects to a Gateway elsewhere)?
gateway.mode: "remote" 并指向一个远程 WebSocket URL,也可以附带共享密钥远程凭据:- 仅当
gateway.mode为local(或你传入覆盖标志)时,openclaw gateway才会启动。 - macOS 应用会监视配置文件,并在这些值变化时实时切换模式。
gateway.remote.token/.password只是客户端侧远程凭据;它们本身不会启用本地 gateway 认证。
The Control UI says "unauthorized" (or keeps reconnecting). What now?
The Control UI says "unauthorized" (or keeps reconnecting). What now?
I set gateway.bind tailnet but it cannot bind and nothing listens
I set gateway.bind tailnet but it cannot bind and nothing listens
tailnet 绑定会从你的网络接口中选择一个 Tailscale IP(100.64.0.0/10)。如果机器没有连接 Tailscale(或者接口已关闭),就没有可绑定的地址。修复:- 在该主机上启动 Tailscale(使其拥有 100.x 地址),或者
- 切换到
gateway.bind: "loopback"/"lan"。
tailnet 是显式设置。auto 默认优先 loopback;当你想要仅 tailnet 绑定时,请使用 gateway.bind: "tailnet"。Can I run multiple Gateways on the same host?
Can I run multiple Gateways on the same host?
OPENCLAW_CONFIG_PATH(每个实例的配置)OPENCLAW_STATE_DIR(每个实例的状态)agents.defaults.workspace(workspace 隔离)gateway.port(唯一端口)
- 每个实例使用
openclaw --profile <name> ...(会自动创建~/.openclaw-<name>)。 - 在每个 profile 的配置中设置唯一的
gateway.port(或者在手动运行时传入--port)。 - 安装每个 profile 的服务:
openclaw --profile <name> gateway install。
ai.openclaw.<profile>;旧版 com.openclaw.*、openclaw-gateway-<profile>.service、OpenClaw Gateway (<profile>))。
完整指南:Multiple gateways。What does "invalid handshake" / code 1008 mean?
What does "invalid handshake" / code 1008 mean?
connect 帧。如果收到其他内容,它会以 code 1008(策略违规)关闭连接。常见原因:- 你在浏览器中打开了 HTTP URL(
http://...),而不是使用 WS 客户端。 - 你使用了错误的端口或路径。
- 代理或隧道去掉了认证头,或者发送了非 Gateway 请求。
- 使用 WS URL:
ws://<host>:18789(如果是 HTTPS,则用wss://...)。 - 不要在普通浏览器标签页中打开 WS 端口。
- 如果启用了认证,请在
connect帧中包含 token/password。
日志和调试
Where are logs?
Where are logs?
logging.file 设置稳定路径。文件日志级别由 logging.level 控制。控制台详细程度由 --verbose 和 logging.consoleLevel 控制。最快的日志尾随方式:- macOS:
$OPENCLAW_STATE_DIR/logs/gateway.log和gateway.err.log(默认:~/.openclaw/logs/...; profiles 使用~/.openclaw-<profile>/logs/...) - Linux:
journalctl --user -u openclaw-gateway[-<profile>].service -n 200 --no-pager - Windows:
schtasks /Query /TN "OpenClaw Gateway (<profile>)" /V /FO LIST
How do I start/stop/restart the Gateway service?
How do I start/stop/restart the Gateway service?
I closed my terminal on Windows - how do I restart OpenClaw?
I closed my terminal on Windows - how do I restart OpenClaw?
The Gateway is up but replies never arrive. What should I check?
The Gateway is up but replies never arrive. What should I check?
- 模型认证未在gateway 主机上加载(检查
models status)。 - channel 配对/allowlist 阻止了回复(检查 channel 配置 + 日志)。
- WebChat/Dashboard 在没有正确 token 的情况下打开。
"Disconnected from gateway: no reason" - what now?
"Disconnected from gateway: no reason" - what now?
- Gateway 是否在运行?
openclaw gateway status - Gateway 是否健康?
openclaw status - UI 是否有正确的 token?
openclaw dashboard - 如果是远程,隧道/Tailscale 链接是否已建立?
Telegram setMyCommands fails. What should I check?
Telegram setMyCommands fails. What should I check?
BOT_COMMANDS_TOO_MUCH:Telegram 菜单条目太多。OpenClaw 已经会裁剪到 Telegram 限制并用更少命令重试,但仍然需要丢弃一些菜单条目。减少插件/技能/自定义命令,或者如果你不需要菜单,请禁用channels.telegram.commands.native。TypeError: fetch failed、Network request for 'setMyCommands' failed!或类似网络错误:如果你在 VPS 上或处于代理后面,请确认允许出站 HTTPS,并且api.telegram.org的 DNS 正常。
TUI shows no output. What should I check?
TUI shows no output. What should I check?
/status 查看当前状态。如果你期望在聊天渠道中收到回复,
请确保已启用投递(/deliver on)。文档:TUI, Slash commands。How do I completely stop then start the Gateway?
How do I completely stop then start the Gateway?
ELI5: openclaw gateway restart vs openclaw gateway
ELI5: openclaw gateway restart vs openclaw gateway
openclaw gateway restart:重启后台服务(launchd/systemd)。openclaw gateway:在这个终端会话中以前台方式运行 gateway。
openclaw gateway。Fastest way to get more details when something fails
Fastest way to get more details when something fails
--verbose 启动 Gateway 以获得更多控制台细节。然后检查日志文件以获取 channel 认证、模型路由和 RPC 错误。媒体和附件
My skill generated an image/PDF, but nothing was sent
My skill generated an image/PDF, but nothing was sent
MEDIA:<path-or-url>。参见 OpenClaw assistant setup 和 Agent send。CLI 发送:- 目标 channel 支持外发媒体,并且没有被 allowlist 阻止。
- 文件大小在提供方限制内(图片会缩放到最大 2048px)。
tools.fs.workspaceOnly=true会将本地路径发送限制在 workspace、temp/media-store 和沙箱验证过的文件中。tools.fs.workspaceOnly=false会让MEDIA:发送代理已可读取的主机本地文件,但仅限媒体和安全文档类型(图片、音频、视频、PDF 和 Office 文档)。纯文本和类似机密的文件仍然会被阻止。
安全与访问控制
Is it safe to expose OpenClaw to inbound DMs?
Is it safe to expose OpenClaw to inbound DMs?
- 支持 DM 的 channel 上的默认行为是 pairing:
- 未知发送者会收到配对码;机器人不会处理其消息。
- 使用以下命令批准:
openclaw pairing approve --channel <channel> [--account <id>] <code> - 待处理请求上限为每个 channel 3 个;如果代码没有到达,请检查
openclaw pairing list --channel <channel> [--account <id>]。
- 公开开放 DMs 需要显式选择加入(
dmPolicy: "open"且 allowlist 为"*")。
openclaw doctor 可以发现有风险的 DM 策略。Is prompt injection only a concern for public bots?
Is prompt injection only a concern for public bots?
- 使用只读或禁用工具的“reader”代理来总结不可信内容
- 对启用工具的代理关闭
web_search/web_fetch/browser - 同样把解码后的文件/文档文本视为不可信:OpenResponses
input_file和媒体附件提取都会把提取出的文本包裹在 显式的外部内容边界标记中,而不是传递原始文件文本 - 沙箱和严格的工具 allowlist
Should my bot have its own email, GitHub account, or phone number?
Should my bot have its own email, GitHub account, or phone number?
Can I give it autonomy over my text messages and is that safe?
Can I give it autonomy over my text messages and is that safe?
- 将 DMs 保持在配对模式或严格 allowlist 中。
- 如果你希望它代表你发消息,请使用单独的号码或账号。
- 让它先起草,然后在发送前批准。
Can I use cheaper models for personal assistant tasks?
Can I use cheaper models for personal assistant tasks?
I ran /start in Telegram but did not get a pairing code
I ran /start in Telegram but did not get a pairing code
dmPolicy: "pairing" 时,才会发送配对码。单独发送 /start
不会生成代码。检查待处理请求:dmPolicy: "open"。WhatsApp: will it message my contacts? How does pairing work?
WhatsApp: will it message my contacts? How does pairing work?
channels.whatsapp.selfChatMode。聊天命令、中止任务和“它不会停止”
How do I stop internal system messages from showing in chat?
How do I stop internal system messages from showing in chat?
verboseDefault 设为
on 的机器人配置文件。Docs: Thinking and verbose, Security.How do I stop/cancel a running task?
How do I stop/cancel a running task?
/ 开头的独立消息发送,但少数快捷方式(如 /status)对于允许列表内发送者也可以内联工作。How do I send a Discord message from Telegram? ("Cross-context messaging denied")
How do I send a Discord message from Telegram? ("Cross-context messaging denied")
Why does it feel like the bot "ignores" rapid-fire messages?
Why does it feel like the bot "ignores" rapid-fire messages?
/queue 更改模式:steer- queue all pending steering for the next model boundary in the current runqueue- legacy one-at-a-time steeringfollowup- run messages one at a timecollect- batch messages and reply oncesteer-backlog- steer now, then process backloginterrupt- abort current run and start fresh
steer. You can add options like debounce:0.5s cap:25 drop:summarize for followup modes. See Command queue and Steering queue。其他
What is the default model for Anthropic with an API key?
What is the default model for Anthropic with an API key?
ANTHROPIC_API_KEY(或在认证配置文件中存储 Anthropic API key)会启用认证,但实际默认模型是你在 agents.defaults.model.primary 中配置的那个(例如,anthropic/claude-sonnet-4-6 或 anthropic/claude-opus-4-6)。如果你看到 No credentials found for profile "anthropic:default",这意味着 Gateway 在运行该代理的预期 auth-profiles.json 中找不到 Anthropic 凭据。Still stuck? 请在 Discord 提问,或打开一个 GitHub discussion。