Skip to content

openclaw

Openclaw

GItHub https://github.com/openclaw/openclaw

官网 https://openclaw.ai/

准备

检查 PowerShell 执行权限

Windows 默认禁止运行脚本,需手动开启

bash
# 以管理员身份运行 PowerShell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# 出现提示时输入 Y 并回车
npm i -g openclaw@2026.2.26

通过 pnpm 安装(不推荐,因为不知道openclaw的安装位置)

bash
$ npm install -g pnpm
#配置 pnpm 环境,执行 pnpm setup 后,必须关闭当前 PowerShell 窗口,打开新的 PowerShell 才能使配置生效
$ pnpm setup
$ pnpm add -g openclaw@latest
$ pnpm add -g openclaw@2026.2.26
#验证版本
$ openclaw --version

初始化配置

bash
$ openclaw onboard --install-daemon
  • 运行模式(Mode) 选择:QuickStart(快速启动,跳过复杂配置)

  • 模型提供商(Provider) 选择:Custom Provider

    Select channel (QuickStart) 选择:Skip for now

    Search provider

    How do you want to hatch your bot? Hatch in TUI (recommended)

验证网关状态

bash
$ openclaw gateway status

预期输出:Gateway is running

访问Web 管理界面

# macOS/Linux
nano ~/.openclaw/openclaw.json
# Windows(PowerShell)
notepad $HOME/.openclaw/openclaw.json

常用命令

openclaw gateway
tui 

openclaw dashboard
http://127.0.0.1:18789/#token=5384bda1344151350d7b8e4f3e8bc942c6997c1059abd1ae

openclaw 支持外网访问非127.0.0.1 访问WebUI

https://blog.csdn.net/qq_34068440/article/details/157697089

https://blog.csdn.net/kitia01/article/details/158454951

$ openclaw config set gateway.bind lan
$ openclaw config set gateway.controlUi.allowInsecureAuth true
$ openclaw gateway restart
http://10.181.129.82:18789/

企微智能机器人

https://open.work.weixin.qq.com/help2/pc/21657?invite_source=19&invite_channel=6&invite_olduser=1&inviter_identity=2&version=5.0.6.91166&platform=mac

bash
$ openclaw plugins install @wecom/wecom-openclaw-plugin

本地先安装,再拷贝到扩展目录,推荐

C:\Users\<用户名>\.openclaw 路径下执行:

powershell
npm config set registry https://registry.npmmirror.com  // 先设置国内镜像
npm cache clean --force
npm install @wecom/wecom-openclaw-plugin --verbose   // 显示下载详细, 主要此包安装比较困难

// 确认安装成功
npm list @wecom/wecom-openclaw-plugin
ls node_modules/@wecom/wecom-openclaw-plugin
bash
#openclaw命令安装
openclaw plugins install @tencent-connect/openclaw-qqbot@latest

#npm方式安装
cd C:\Users\lyl07583\.openclaw\
npm install @tencent-connect/openclaw-qqbot@latest --verbose

mkdir extensions\openclaw-qqbot
xcopy /E /Y "node_modules\@tencent-connect\openclaw-qqbot\*" "extensions\openclaw-qqbot\"
cd extensions\openclaw-qqbot
npm install --prod // 很重要一步,不换源也很慢或者失败,因为要从github下载依赖

将安装好的包复制到 OpenClaw 的扩展目录:

powershell
// 创建扩展目录并复制文件
mkdir extensions
mkdir extensions\wecom-openclaw-plugin
xcopy /E /Y "node_modules\@wecom\wecom-openclaw-plugin\*" "extensions\wecom-openclaw-plugin\"

// 安装依赖
cd extensions\wecom-openclaw-plugin

npm install --prod // 很重要一步,不换源也很慢或者失败,因为要从github下载依赖
bash
$ npm install --prod
npm error An unknown git error occurred
npm error command git --no-replace-objects ls-remote ssh://git@github.com/whiskeysockets/libsignal-node.git
npm error git@github.com: Permission denied (publickey).
npm error fatal: Could not read from remote repository.

完成后重启 OpenClaw 服务:

bash
openclaw gateway restart

记录

$ openclaw onboard --install-daemon

🦞 OpenClaw 2026.2.26 (bc50708) — The only crab in your contacts you actually want to hear from. 🦞

Windows detected — OpenClaw runs great on WSL2!
Native Windows might be trickier.
Quick setup: wsl --install (one command, one reboot)
Guide: https://docs.openclaw.ai/windows
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██░▄▄▄░██░▄▄░██░▄▄▄██░▀██░██░▄▄▀██░████░▄▄▀██░███░██
██░███░██░▀▀░██░▄▄▄██░█░█░██░█████░████░▀▀░██░█░█░██
██░▀▀▀░██░█████░▀▀▀██░██▄░██░▀▀▄██░▀▀░█░██░██▄▀▄▀▄██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                  🦞 OPENCLAW 🦞

┌  OpenClaw onboarding

◇  Security ─────────────────────────────────────────────────────────────────────────────────╮
│                                                                                            │
│  Security warning — please read.                                                           │
│                                                                                            │
│  OpenClaw is a hobby project and still in beta. Expect sharp edges.                        │
│  By default, OpenClaw is a personal agent: one trusted operator boundary.                  │
│  This bot can read files and run actions if tools are enabled.                             │
│  A bad prompt can trick it into doing unsafe things.                                       │
│                                                                                            │
│  OpenClaw is not a hostile multi-tenant boundary by default.                               │
│  If multiple users can message one tool-enabled agent, they share that delegated tool      │
│  authority.                                                                                │
│                                                                                            │
│  If you’re not comfortable with security hardening and access control, don’t run           │
│  OpenClaw.                                                                                 │
│  Ask someone experienced to help before enabling tools or exposing it to the internet.     │
│                                                                                            │
│  Recommended baseline:                                                                     │
│  - Pairing/allowlists + mention gating.                                                    │
│  - Multi-user/shared inbox: split trust boundaries (separate gateway/credentials, ideally  │
│    separate OS users/hosts).                                                               │
│  - Sandbox + least-privilege tools.                                                        │
│  - Shared inboxes: isolate DM sessions (`session.dmScope: per-channel-peer`) and keep      │
│    tool access minimal.                                                                    │
│  - Keep secrets out of the agent’s reachable filesystem.                                   │
│  - Use the strongest available model for any bot with tools or untrusted inboxes.          │
│                                                                                            │
│  Run regularly:                                                                            │
│  openclaw security audit --deep                                                            │
│  openclaw security audit --fix                                                             │
│                                                                                            │
│  Must read: https://docs.openclaw.ai/gateway/security                                      │
│                                                                                            │
├────────────────────────────────────────────────────────────────────────────────────────────╯

◇  I understand this is personal-by-default and shared/multi-user use requires lock-down. Continue?
│  Yes

◇  Onboarding mode
│  QuickStart

◇  Existing config detected ─────────────────────╮
│                                                │
│  workspace: ~\.openclaw\workspace              │
│  model: qwen3-14b-oneai-xxxx-com/qwen3-14b  │
│  gateway.mode: local                           │
│  gateway.port: 18789                           │
│  gateway.bind: loopback                        │
│                                                │
├────────────────────────────────────────────────╯

◇  Config handling
│  Reset

◇  Reset scope
│  Full reset (config + creds + sessions + workspace)
Failed to move to Trash (manual delete): ~\.openclaw\openclaw.json
Failed to move to Trash (manual delete): ~\.openclaw\agents\main\sessions
Failed to move to Trash (manual delete): ~\.openclaw\workspace

◇  QuickStart ─────────────────────────╮
│                                      │
│  Gateway port: 18789                 │
│  Gateway bind: Loopback (127.0.0.1)  │
│  Gateway auth: Token (default)       │
│  Tailscale exposure: Off             │
│  Direct to chat channels.            │
│                                      │
├──────────────────────────────────────╯

◇  Model/auth provider
│  Custom Provider

◇  API Base URL
│  https://xxx.com/v1

◇  How do you want to provide this API key?
│  Paste API key now

◇  API Key (leave blank if not required)
│  sk-c231ac07-e91b-11f0-aedb-7ac65e7538f7

◇  Endpoint compatibility
│  OpenAI-compatible

◇  Model ID
│  qwen3-14b

◇  Verification successful.

◇  Endpoint ID
│  qwen3-14b

◇  Model alias (optional)

Configured custom provider: qwen3-14b/qwen3-14b

◇  Channel status ────────────────────────────╮
│                                             │
│  Telegram: needs token                      │
│  WhatsApp (default): not linked             │
│  Discord: needs token                       │
│  Slack: needs tokens                        │
│  Signal: needs setup                        │
│  signal-cli: missing (signal-cli)           │
│  iMessage: needs setup                      │
│  imsg: missing (imsg)                       │
│  IRC: not configured                        │
│  Google Chat: not configured                │
│  Feishu: install plugin to enable           │
│  Google Chat: install plugin to enable      │
│  Nostr: install plugin to enable            │
│  Microsoft Teams: install plugin to enable  │
│  Mattermost: install plugin to enable       │
│  Nextcloud Talk: install plugin to enable   │
│  Matrix: install plugin to enable           │
│  BlueBubbles: install plugin to enable      │
│  LINE: install plugin to enable             │
│  Zalo: install plugin to enable             │
│  Zalo Personal: install plugin to enable    │
│  Synology Chat: install plugin to enable    │
│  Tlon: install plugin to enable             │
│                                             │
├─────────────────────────────────────────────╯

◇  How channels work ───────────────────────────────────────────────────────────────────────╮
│                                                                                           │
│  DM security: default is pairing; unknown DMs get a pairing code.                         │
│  Approve with: openclaw pairing approve <channel> <code>                                  │
│  Public DMs require dmPolicy="open" + allowFrom=["*"].                                    │
│  Multi-user DMs: run: openclaw config set session.dmScope "per-channel-peer" (or          │
│  "per-account-channel-peer" for multi-account channels) to isolate sessions.              │
│  Docs: channels/pairing              │
│                                                                                           │
│  Telegram: simplest way to get started — register a bot with @BotFather and get going.    │
│  WhatsApp: works with your own number; recommend a separate phone + eSIM.                 │
│  Discord: very well supported right now.                                                  │
│  IRC: classic IRC networks with DM/channel routing and pairing controls.                  │
│  Google Chat: Google Workspace Chat app with HTTP webhook.                                │
│  Slack: supported (Socket Mode).                                                          │
│  Signal: signal-cli linked device; more setup (David Reagans: "Hop on Discord.").         │
│  iMessage: this is still a work in progress.                                              │
│  Feishu: 飞书/Lark enterprise messaging with doc/wiki/drive tools.                        │
│  Nostr: Decentralized protocol; encrypted DMs via NIP-04.                                 │
│  Microsoft Teams: Bot Framework; enterprise support.                                      │
│  Mattermost: self-hosted Slack-style chat; install the plugin to enable.                  │
│  Nextcloud Talk: Self-hosted chat via Nextcloud Talk webhook bots.                        │
│  Matrix: open protocol; install the plugin to enable.                                     │
│  BlueBubbles: iMessage via the BlueBubbles mac app + REST API.                            │
│  LINE: LINE Messaging API bot for Japan/Taiwan/Thailand markets.                          │
│  Zalo: Vietnam-focused messaging platform with Bot API.                                   │
│  Zalo Personal: Zalo personal account via QR code login.                                  │
│  Synology Chat: Connect your Synology NAS Chat to OpenClaw with full agent capabilities.  │
│  Tlon: decentralized messaging on Urbit; install the plugin to enable.                    │
│                                                                                           │
├───────────────────────────────────────────────────────────────────────────────────────────╯

◇  Select channel (QuickStart)
│  Skip for now
Config overwrite: C:\Users\lyl07583\.openclaw\openclaw.json (sha256 f69b807131a3dc664bd39c5a8cd7a52cc3d555040a0f4e78bc9969e4b397cee6 -> f595335cf4cd1c01988cbb3d258392aa4e37b6c18445e76ad2f4869cb4e1b89b, backup=C:\Users\lyl07583\.openclaw\openclaw.json.bak)
Updated ~\.openclaw\openclaw.json
Workspace OK: ~\.openclaw\workspace
Sessions OK: ~\.openclaw\agents\main\sessions

◇  Skills status ─────────────╮
│                             │
│  Eligible: 7                │
│  Missing requirements: 39   │
│  Unsupported on this OS: 8  │
│  Blocked by allowlist: 0    │
│                             │
├─────────────────────────────╯

◇  Configure skills now? (recommended)
│  Yes

◇  Install missing skill dependencies
│  Skip for now

◇  Set GOOGLE_PLACES_API_KEY for goplaces?
│  No

◇  Set GEMINI_API_KEY for nano-banana-pro?
│  No

◇  Set NOTION_API_KEY for notion?
│  No

◇  Set OPENAI_API_KEY for openai-image-gen?
│  No

◇  Set OPENAI_API_KEY for openai-whisper-api?
│  No

◇  Set ELEVENLABS_API_KEY for sag?
│  No

◇  Hooks ──────────────────────────────────────────────────────────────────╮
│                                                                          │
│  Hooks let you automate actions when agent commands are issued.          │
│  Example: Save session context to memory when you issue /new or /reset.  │
│                                                                          │
│  Learn more: https://docs.openclaw.ai/automation/hooks                   │
│                                                                          │
├──────────────────────────────────────────────────────────────────────────╯

◇  Enable hooks?
│  🚀 boot-md, 📎 bootstrap-extra-files, 📝 command-logger, 💾 session-memory

◇  Hooks Configured ────────────────────────────────────────────────────────────────╮
│                                                                                   │
│  Enabled 4 hooks: boot-md, bootstrap-extra-files, command-logger, session-memory  │
│                                                                                   │
│  You can manage hooks later with:                                                 │
│    openclaw hooks list                                                            │
│    openclaw hooks enable <name>                                                   │
│    openclaw hooks disable <name>                                                  │
│                                                                                   │
├───────────────────────────────────────────────────────────────────────────────────╯
Config overwrite: C:\Users\lyl07583\.openclaw\openclaw.json (sha256 f595335cf4cd1c01988cbb3d258392aa4e37b6c18445e76ad2f4869cb4e1b89b -> 4aafbe39d233aaf3c86a2cf308a325fe5a4b8b65ee6e0e718470378a4d4e7524, backup=C:\Users\lyl07583\.openclaw\openclaw.json.bak)

◇  Gateway service runtime ────────────────────────────────────────────╮
│                                                                      │
│  QuickStart uses Node for the Gateway service (stable + supported).  │
│                                                                      │
├──────────────────────────────────────────────────────────────────────╯

◇  Gateway service already installed
│  Reinstall

◑  Uninstalling Gateway service…Removed task script: C:\Users\lyl07583\.openclaw\gateway.cmd
◇  Gateway service uninstalled.

◒  Installing Gateway service….
Installed Scheduled Task: OpenClaw Gateway
Task script: C:\Users\lyl07583\.openclaw\gateway.cmd
◇  Gateway service installed.


Agents: main (default)
Heartbeat interval: 30m (main)
Session store (main): C:\Users\lyl07583\.openclaw\agents\main\sessions\sessions.json (1 entries)
- agent:main:main (126m ago)

◇  Optional apps ────────────────────────╮
│                                        │
│  Add nodes for extra features:         │
│  - macOS app (system + notifications)  │
│  - iOS app (camera/canvas)             │
│  - Android app (camera/canvas)         │
│                                        │
├────────────────────────────────────────╯

◇  Control UI ─────────────────────────────────────────────────────────────────────╮
│                                                                                  │
│  Web UI: http://127.0.0.1:18789/                                                 │
│  Web UI (with token):                                                            │
│  http://127.0.0.1:18789/#token=72381c0a7928ddd4457779d437153da2bb41b0c2159086cc  │
│  Gateway WS: ws://127.0.0.1:18789                                                │
│  Gateway: reachable                                                              │
│  Docs: https://docs.openclaw.ai/web/control-ui                                   │
│                                                                                  │
├──────────────────────────────────────────────────────────────────────────────────╯

◇  Start TUI (best option!) ─────────────────────────────────╮
│                                                            │
│  This is the defining action that makes your agent you.    │
│  Please take your time.                                    │
│  The more you tell it, the better the experience will be.  │
│  We will send: "Wake up, my friend!"                       │
│                                                            │
├────────────────────────────────────────────────────────────╯

◇  Token ─────────────────────────────────────────────────────────────────────────────────╮
│                                                                                         │
│  Gateway token: shared auth for the Gateway + Control UI.                               │
│  Stored in: ~/.openclaw/openclaw.json (gateway.auth.token) or OPENCLAW_GATEWAY_TOKEN.   │
│  View token: openclaw config get gateway.auth.token                                     │
│  Generate token: openclaw doctor --generate-gateway-token                               │
│  Web UI stores a copy in this browser's localStorage (openclaw.control.settings.v1).    │
│  Open the dashboard anytime: openclaw dashboard --no-open                               │
│  If prompted: paste the token into Control UI settings (or use the tokenized dashboard  │
│  URL).                                                                                  │
│                                                                                         │
├─────────────────────────────────────────────────────────────────────────────────────────╯

◇  How do you want to hatch your bot?
│  Open the Web UI

◇  Dashboard ready ────────────────────────────────────────────────────────────────╮
│                                                                                  │
│  Dashboard link (with token):                                                    │
│  http://127.0.0.1:18789/#token=72381c0a7928ddd4457779d437153da2bb41b0c2159086cc  │
│  Opened in your browser. Keep that tab to control OpenClaw.                      │
│                                                                                  │
├──────────────────────────────────────────────────────────────────────────────────╯

◇  Workspace backup ────────────────────────────────────────╮
│                                                           │
│  Back up your agent workspace.                            │
│  Docs: https://docs.openclaw.ai/concepts/agent-workspace  │
│                                                           │
├───────────────────────────────────────────────────────────╯

◇  Security ──────────────────────────────────────────────────────╮
│                                                                 │
│  Running agents on your computer is risky — harden your setup:  │
│  https://docs.openclaw.ai/security                              │
│                                                                 │
├─────────────────────────────────────────────────────────────────╯

◇  Web search (optional) ─────────────────────────────────────────────────────────────────╮
│                                                                                         │
│  If you want your agent to be able to search the web, you’ll need an API key.           │
│                                                                                         │
│  OpenClaw uses Brave Search for the `web_search` tool. Without a Brave Search API key,  │
│  web search won’t work.                                                                 │
│                                                                                         │
│  Set it up interactively:                                                               │
│  - Run: openclaw configure --section web                                                │
│  - Enable web_search and paste your Brave Search API key                                │
│                                                                                         │
│  Alternative: set BRAVE_API_KEY in the Gateway environment (no config changes).         │
│  Docs: https://docs.openclaw.ai/tools/web                                               │
│                                                                                         │
├─────────────────────────────────────────────────────────────────────────────────────────╯

◇  What now ─────────────────────────────────────────────────────────────╮
│                                                                        │
│  What now: https://openclaw.ai/showcase ("What People Are Building").  │
│                                                                        │
├────────────────────────────────────────────────────────────────────────╯

└  Onboarding complete. Dashboard opened; keep that tab to control OpenClaw.

核心报错:spawn EINVAL

Model context window too small

Agent failed before reply: Model context window too small (4096 tokens). Minimum is 16000. Logs: openclaw logs --follow

问题分析

对于自定义的模型,openclaw给的默认值时4096,需要手动编辑配置文件修改值

https://blog.csdn.net/Numb_ZL/article/details/158535015

https://juejin.cn/post/7605529884824567871

https://xmuli.tech/posts/4e21d8f5/

https://cloud.tencent.com/developer/article/2626160

https://zhuanlan.zhihu.com/p/2013791646978966583

上次更新时间:

最近更新