OpenClaw是个啥?
简单说:OpenClaw 是一个开源的个人 AI 助手平台,支持通过多种消息渠道与 AI 交互,让你能把 AI 代理(agent)连接到日常生活和工作流中,处理生活工作中的各种任务。
系统要求
≥ 22node --version 检查) | |
安装步骤
1.安装nodejs环境:macOS 升级node到指定版本
2.获取 AI 提供商密钥,免费试用阿里云(百炼平台)API体验额度:OpenClaw接入文档
核心权益: 每个模型 100 万 Tokens。
领取地址: 阿里云百炼控制台
领取步骤:
1)登录百炼控制台。
2)阅读并同意协议后,系统将自动开通阿里云百炼并发放免费推理额度。
特性: 有效期3个月。
支持系列: 千问全系、DeepSeek 全系、Kimi 系列、MiniMax 系列、GLM 智谱系列。
3.安装/配置OpenClaw:OpenClaw保姆安装教程 | OpenClaw橙皮书-从入门到精通.pdf
安装 OpenClaw:npm install -g openclaw@latest
初始化并安装守护进程:openclaw onboard --install-daemon
> npm install -g openclaw@latest 22:54:12 npm warn deprecated [email protected]: Use your platform's native DOMException instead added 534 packages in 59s 96 packages are looking for funding run `npm fund` for details > openclaw onboard --install-daemon 22:58:07 🦞 OpenClaw 2026.3.8 (3caab92) — Open source means you can see exactly how I judge your config. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ██░▄▄▄░██░▄▄░██░▄▄▄██░▀██░██░▄▄▀██░████░▄▄▀██░███░██ ██░███░██░▀▀░██░▄▄▄██░█░█░██░█████░████░▀▀░██░█░█░██ ██░▀▀▀░██░█████░▀▀▀██░██▄░██░▀▀▄██░▀▀░█░██░██▄▀▄▀▄██ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ 🦞 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 │ ◇ 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://dashscope.aliyuncs.com/compatible-mode/v1 │ ◇ How do you want to provide this API key? │ Paste API key now │ ◇ API Key (leave blank if not required) │ sk-xxxooo │ ◇ Endpoint compatibility │ OpenAI-compatible │ ◇ Model ID │ qwen-plus │ ◇ Verification successful. │ ◇ Endpoint ID │ custom-dashscope-aliyuncs-com │ ◇ Model alias (optional) │ Configured custom provider: custom-dashscope-aliyuncs-com/qwen-plus │ ◇ 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 │ │ LINE: 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. │ │ LINE: LINE Messaging API webhook bot. │ │ 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. │ │ 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 Updated ~/.openclaw/openclaw.json Workspace OK: ~/.openclaw/workspace Sessions OK: ~/.openclaw/agents/main/sessions │ ◇ Web search ────────────────────────────────────────╮ │ │ │ Web search lets your agent look things up online. │ │ Choose a provider and paste your API key. │ │ Docs: https://docs.openclaw.ai/tools/web │ │ │ ├─────────────────────────────────────────────────────╯ │ ◇ Search provider │ Skip for now │ ◇ Skills status ─────────────╮ │ │ │ Eligible: 3 │ │ Missing requirements: 48 │ │ Unsupported on this OS: 0 │ │ Blocked by allowlist: 0 │ │ │ ├─────────────────────────────╯ │ ◇ Configure skills now? (recommended) │ 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? │ Skip for now Config overwrite: /Users/buhaihui/.openclaw/openclaw.json (sha256 581c8ed510ec4559901d459d066548468f72796357a5832fcf102b01fed34664 -> fca7ba4e02ba957f8762db644b7d98787db07c3840d287029a5b9fa305a6f9c6, backup=/Users/buhaihui/.openclaw/openclaw.json.bak) │ ◇ Gateway service runtime ────────────────────────────────────────────╮ │ │ │ QuickStart uses Node for the Gateway service (stable + supported). │ │ │ ├──────────────────────────────────────────────────────────────────────╯ │ ◒ Installing Gateway service…. Installed LaunchAgent: /Users/buhaihui/Library/LaunchAgents/ai.openclaw.gateway.plist Logs: /Users/buhaihui/.openclaw/logs/gateway.log ◇ Gateway service installed. │ ◇ Agents: main (default) Heartbeat interval: 30m (main) Session store (main): /Users/buhaihui/.openclaw/agents/main/sessions/sessions.json (0 entries) │ ◇ 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=b335b8d2ac131c84fb63ecf8d79ee2d14c8e1ded73f7aa3c │ │ 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 keeps dashboard URL tokens in memory for the current tab and strips them from the │ │ URL after load. │ │ 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? │ Do this later │ ◇ Later ───────────────────────────────────────────╮ │ │ │ When you're ready: openclaw dashboard --no-open │ │ │ ├───────────────────────────────────────────────────╯ │ ◇ 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 │ │ │ ├─────────────────────────────────────────────────────────────────╯ │ ◇ Shell completion ───────────────────────────────────────────────────────╮ │ │ │ Shell completion installed. Restart your shell or run: source ~/.zshrc │ │ │ ├──────────────────────────────────────────────────────────────────────────╯ │ ◇ Web search ───────────────────────────────────────╮ │ │ │ Web search was skipped. You can enable it later: │ │ openclaw configure --section web │ │ │ │ Docs: https://docs.openclaw.ai/tools/web │ │ │ ├────────────────────────────────────────────────────╯ │ ◇ What now ─────────────────────────────────────────────────────────────╮ │ │ │ What now: https://openclaw.ai/showcase ("What People Are Building"). │ │ │ ├────────────────────────────────────────────────────────────────────────╯ │ └ Onboarding complete. Use the dashboard link above to control OpenClaw.
使用OpenClaw
TUI 终端管理:openclaw tui
浏览器访问:openclaw dashboard
停止openclaw:
# 方法1:OpenClaw 官方停止命令
openclaw gateway stop
# 方法2:强制杀死所有 OpenClaw 进程(推荐)
pkill -f openclaw
# 方法3:杀死占用 18789 端口的进程(若端口被占用)
lsof -i :18789 | grep -v PID | awk '{print $2}' | xargs kill -9 2>/dev/nullOpenClaw 命令速查表
核心命令
| 命令 | 说明 |
|---|---|
openclaw --help | 显示所有命令 |
openclaw --version | 显示版本号 |
openclaw status | 显示频道健康和最近会话 |
openclaw dashboard | 打开控制 UI |
openclaw tui | 打开终端 UI |
openclaw docs | 搜索在线文档 |
openclaw doctor | 健康检查 + 快速修复 |
Gateway(网关)
openclaw gateway # 启动本地网关 openclaw gateway --port 18789 # 指定端口 openclaw gateway --force # 强制启动(杀占用进程) openclaw gateway status # 查看网关状态 openclaw gateway stop # 停止网关 openclaw gateway restart # 重启网关 openclaw logs --follow # 跟踪网关日志
Agent(代理)
openclaw agent --message "任务描述" # 运行一次 agent openclaw agent --to +1234567890 --message "Hi" # 发送到指定目标 openclaw agents list # 列出所有 agent openclaw agents kill <id> # 终止 agent
Channels(频道)
openclaw channels list # 列出已登录频道 openclaw channels login --verbose # 登录新频道(显示 QR) openclaw message send --channel telegram --target @chat --message "Hi" openclaw message read <id> # 读取消息 openclaw directory lookup <name> # 查找联系人/群组 ID
Memory(记忆)
openclaw memory search "关键词" # 搜索记忆 openclaw memory reindex # 重建索引
Cron(定时任务)
openclaw cron list # 列出定时任务 openclaw cron add # 添加任务 openclaw cron run <jobId> # 立即执行任务 openclaw cron runs <jobId> # 查看执行历史
Config & Security(配置与安全)
openclaw config # 配置向导 openclaw config get <key> # 获取配置 openclaw config set <key> <value> # 设置配置 openclaw security audit # 安全检查 openclaw secrets list # 列出密钥
Skills & Plugins(技能与插件)
openclaw skills list # 列出可用技能 openclaw skills inspect <name> # 查看技能详情 openclaw plugins list # 列出插件 openclaw plugins install <name> # 安装插件
Update & Backup(更新与备份)
openclaw update check # 检查更新 openclaw update install # 安装更新 openclaw backup create # 创建备份 openclaw backup verify # 验证备份 openclaw reset # 重置配置(保留 CLI)
高级命令
| 命令 | 说明 |
|---|---|
openclaw acp * | Agent Control Protocol 工具 |
openclaw browser * | 管理浏览器(Chrome/Chromium) |
openclaw node * | 管理无节点主机服务 |
openclaw sandbox * | 管理沙盒容器 |
openclaw webhooks * | Webhook 集成 |
openclaw models * | 模型发现与配置 |
openclaw sessions * | 查看存储的会话 |
openclaw approvals * | 管理执行审批 |
常用示例
# 发送 WhatsApp 消息 openclaw message send --target +15555550123 --message "Hi" # 运行 agent 并发送回复 openclaw agent --to +15555550123 --message "总结今天的工作" --deliver # 开发模式(隔离状态) openclaw --dev gateway # 生成 Shell 补全 openclaw completion > ~/.bash_completion # 查看模型配置 openclaw models list
完整文档: https://docs.openclaw.ai/cli
参考:



小龙虾很好,但是太烧token了。在火山引擎上充了5块钱没聊几句就欠费了。现在用火山引擎coding plan。
@小草的日记本 这龙虾确实太吃token了,我都是用白嫖体验的在玩