OpenClaw 最新保姆级飞书对接指南教程 搭建属于你的 AI 助手
OpenClaw 是什么OpenClaw(原名 Clawdbot,后更名为 Moltbot,现正式命名为 OpenClaw)是一个运行在你本地环境的高权限 AI 智能体。它的核心特性包括本地部署运行在你的服务器或电脑上,数据完全自主可控多平台支持支持飞书、WhatsApp、Telegram、Discord、Slack 等主流聊天工具浏览器控制可以浏览网页、填写表单、提取数据系统访问读写文件、执行 Shell 命令、运行脚本持久化记忆记住你的偏好和上下文,成为真正属于你的 AI插件扩展支持社区技能插件,甚至可以自己编写插件无论是邮件管理、日程安排、数据查询还是代码编写,OpenClaw 都能成为你的得力助手。OpenClaw 安装前的准备工作安装 OpenClaw 需要满足以下环境要求项目要求操作系统Linux推荐/ macOS / Windows (WSL2)Node.js≥ 22.x内存≥ 2GB建议 4GB否则需配置 swap网络能访问 GitHub、npm 仓库国内服务器可能需要代理AI 模型通义千问、OpenAI、Claude、KIMI 等任一 API Key千问免费额度充足安装 OpenClaw 依赖环境如果你不想手动安装依赖、配置环境可以直接使用 阿里云 OpenClaw 一键部署几分钟即可完成 OpenClaw 服务器搭建。如果你选择手动安装继续往下看。第一步安装 Git# 安装 Git sudo apt update sudo apt install git -y第二步安装 Node.js# 安装 NVM # 国内使用 gitee 的镜像源 curl -o- https://gitee.com/RubyMetric/nvm-cn/raw/main/install.sh | bash # 国外使用 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash # 重新加载环境变量 source ~/.bashrc # 安装 Node.js 22 nvm install 22 # 查看 nodejs 版本 node -v # 输出 v22 即可版本只要 22 就行安装 OpenClaw 开源 AI 助手# 使用官方脚本安装 curl -fsSL https://openclaw.bot/install.sh | bash服务器在国内如果安装失败的话可能需要解决网络问题其他平台安装方式请参考OpenClaw 安装文档 (原 Clawdbot)你会看到如下 OpenClaw Installer Siris competent cousin. ✓ Detected: linux ✓ Node.js v22.22.0 found ✓ Git already installed → Installing OpenClaw 2026.2.6-3... ✓ OpenClaw installed OpenClaw installed successfully (2026.2.6-3)! Home sweet home. Dont worry, I wont rearrange the furniture. Starting setup... OpenClaw 2026.2.6-3 (85ed6c7) — curl for conversations. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ██░▄▄▄░██░▄▄░██░▄▄▄██░▀██░██░▄▄▀██░████░▄▄▀██░███░██ ██░███░██░▀▀░██░▄▄▄██░█░█░██░█████░████░▀▀░██░█░█░██ ██░▀▀▀░██░█████░▀▀▀██░██▄░██░▀▀▄██░▀▀░█░██░██▄▀▄▀▄██ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ OPENCLAW ┌ OpenClaw onboarding如果首次安装时间会很长需要耐心等待。如果最后输出如下内容→ npm install failed; cleaning up and retrying...新的脚本服务器内存要求变高了据我使用下来 2G 内存肯定会 OOM如果出错的话建议使用swap把硬盘空间当作交互内存使用。成功之后会输出会看到下面的输出┌ OpenClaw onboarding │ ◇ Security ──────────────────────────────────────────────────────────────────────────────╮ │ │ │ Security warning — please read. │ │ │ │ OpenClaw is a hobby project and still in beta. Expect sharp edges. │ │ This bot can read files and run actions if tools are enabled. │ │ A bad prompt can trick it into doing unsafe things. │ │ │ │ If youre not comfortable with basic security and access control, dont run OpenClaw. │ │ Ask someone experienced to help before enabling tools or exposing it to the internet. │ │ │ │ Recommended baseline: │ │ - Pairing/allowlists mention gating. │ │ - Sandbox least-privilege tools. │ │ - Keep secrets out of the agents 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 powerful and inherently risky. Continue? │ ● Yes / ○ No └第一个选项就是询问你是否知道风险的需要选择yes, 然后回车。第二步选择QuickStart◆ Onboarding mode │ ● QuickStart (Configure details later via openclaw configure.) │ ○ Manual └第三步选择模型服务商这里选择Qwen免费额度充足适合入门快速使用◆ Model/auth provider │ ○ OpenAI │ ○ Anthropic │ ○ MiniMax │ ○ Moonshot AI (Kimi K2.5) │ ○ Google │ ○ xAI (Grok) │ ○ OpenRouter │ ● Qwen (OAuth) │ ○ Z.AI (GLM 4.7) │ ○ Qianfan │ ○ Copilot │ ○ Vercel AI Gateway │ ○ OpenCode Zen │ ○ Xiaomi │ ○ Synthetic │ ○ Venice AI │ ○ Cloudflare AI Gateway │ ○ Skip for now └选择千问模型后选择Qwen OAuth之后 会提供一个链接复制并在浏览器中打开Qwen auth method │ ● Qwen OAuth │ ○ Back └Starting Qwen OAuth… ◇ Qwen OAuth ─────────────────────────────────────────────────────────────────────────╮ │ │ │ Open https://chat.qwen.ai/authorize?user_code-AYWBJHLclientqwen-code to approve │ │ access. │ │ If prompted, enter the code -AYWBJHL. │ │ │ ├──────────────────────────────────────────────────────────────────────────────────────╯ ◓ Waiting for Qwen OAuth approval…...复制链接后打开浏览器会看到如下界面。由于我已登录过所以显示账户信息如果尚未登录按照提示完成登录即可。登录完成后会出现以下选项提示选择对应的千问模型如下图◇ Qwen OAuth complete │ ◇ Model configured ─────────────────────────────╮ │ │ │ Default model set to qwen-portal/coder-model │ │ │ ├────────────────────────────────────────────────╯ │ ◇ Provider notes ──────────────────────────────────────────────────────────────────────╮ │ │ │ Qwen OAuth tokens auto-refresh. Re-run login if refresh fails or access is revoked. │ │ Base URL defaults to https://portal.qwen.ai/v1. Override │ │ models.providers.qwen-portal.baseUrl if needed. │ │ │ ├───────────────────────────────────────────────────────────────────────────────────────╯ │ ◆ Default model │ ● Keep current (qwen-portal/coder-model) │ ○ Enter model manually │ ○ qwen-portal/coder-model │ ○ qwen-portal/vision-model └选择默认模型Keep current (qwen-portal/coder-model)即可。接下来会提示选择 channel这里先跳过后续再添加。之前飞书都没有内置的现在新版本飞书已经内置了Select channel (QuickStart) │ ○ Telegram (Bot API) (not configured) │ ○ WhatsApp (QR link) │ ○ Discord (Bot API) │ ○ Google Chat (Chat API) │ ○ Slack (Socket Mode) │ ○ Signal (signal-cli) │ ○ iMessage (imsg) │ ○ Feishu/Lark (飞书) │ ○ Nostr (NIP-04 DMs) │ ○ Microsoft Teams (Bot Framework) │ ○ Mattermost (plugin) │ ○ Nextcloud Talk (self-hosted) │ ○ Matrix (plugin) │ ○ BlueBubbles (macOS app) │ ○ LINE (Messaging API) │ ○ Zalo (Bot API) │ ○ Zalo (Personal Account) │ ○ Tlon (Urbit) │ ● Skip for now └继续下面选择 skills也是选择NoSkills status ────────────╮ │ │ │ Eligible: 6 │ │ Missing requirements: 43 │ │ Blocked by allowlist: 0 │ │ │ ├────────────────────────────╯ │ ◆ Configure skills now? (recommended) │ ○ Yes / ● No └然后等待安装完成最后会出现以下选项这里选择TUI◆ How do you want to hatch your bot? │ ● Hatch in TUI (recommended) │ ○ Open the Web UI │ ○ Do this later └如果看到 TUI 聊天界面说明安装成功可以尝试输入Hello进行测试。然后直接使用ctrlc先关闭后面我们再来设置查看 OpenClaw 服务状态可以使用下面的命令来查看openclaw status会看到如下图的结果就说明服务启动了 OpenClaw 2026.2.6-3 (85ed6c7) — I read logs so you can keep pretending you dont have to. │ ◇ │ ◇ OpenClaw status Overview ┌─────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Item │ Value │ ├─────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ Dashboard │ http://127.0.0.1:18789/ │ │ OS │ linux 6.8.0-71-generic (x64) · node 22.22.0 │ │ Tailscale │ off │ │ Channel │ stable (default) │ │ Update │ pnpm · npm latest 2026.2.6-3 │ │ Gateway │ local · ws://127.0.0.1:18789 (local loopback) · reachable 42ms · auth token · VM-16-7-ubuntu (10.0.16.7) app unknown linux 6.8.0-71-generic │ │ Gateway service │ systemd installed · enabled · running (pid 327748, state active) │ │ Node service │ systemd not installed │ │ Agents │ 1 · 1 bootstrapping · sessions 1 · default main active 1m ago │ │ Memory │ enabled (plugin memory-core) · unavailable │ │ Probes │ skipped (use --deep) │ │ Events │ none │ │ Heartbeat │ 30m (main) │ │ Sessions │ 1 active · default coder-model (128k ctx) · ~/.openclaw/agents/main/sessions/sessions.json │ └─────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘访问 OpenClaw Web UI 管理面板如何访问面板服务监听在http://127.0.0.1:18789/端口上我们现在通过 ssh 隧道来访问输入下面的命令ssh -N -L 18789:127.0.0.1:18789 用户名服务器IP # 回车之后 用户名服务器IPs password: # 输入密码然后在浏览器打开http://127.0.0.1:18789/, 你会看到 Dashboard 了如下图图中显示的是未授权状态回到服务器输入以下命令clawdbot dashboard会看到下面的面板数据有这个Dashboard URLopenclaw dashboard OpenClaw 2026.2.6-3 (85ed6c7) — Works on Android. Crazy concept, we know. Dashboard URL: http://127.0.0.1:18789/#tokene8e5cd1573123ae9b11111111111111e2b94b8b7b4ccd Copy to clipboard unavailable. No GUI detected. Open from your computer: ssh -N -L 18789:127.0.0.1:18789 ubuntu222222 Then open: http://localhost:18789/ http://localhost:18789/#tokene8e5cd1573123ae9b11111111111111e2b94b8b7b4ccd Docs: https://docs.openclaw.ai/gateway/remote https://docs.openclaw.ai/web/control-ui复制对应的Dashboard URL到浏览器打开即可正常查看聊天记录。至此 OpenClaw 开源 AI 助手已安装完成可以正常访问了。接下来在聊天框首次输入HelloOpenClaw 会询问你它应该叫什么、应该叫你什么。你需要给这个 AI 助手设置一个名字以及它对你的称呼。可以在聊天框这么输入Name: OpenClaw My Name: BossOpenClaw 对接飞书机器人教程下面是本篇 OpenClaw 飞书教程的核心部分。回到刚才添加channels的配置选择飞书添加。如有遗漏可以看官方文档OpenClaw 飞书对接◆ Select a channel │ ○ Telegram (Bot API) │ ○ WhatsApp (QR link) │ ○ Discord (Bot API) │ ○ Google Chat (Chat API) │ ○ Slack (Socket Mode) │ ○ Signal (signal-cli) │ ○ iMessage (imsg) │ ○ Feishu/Lark (飞书) │ ○ Nostr (NIP-04 DMs) │ ○ Microsoft Teams (Bot Framework) │ ○ Mattermost (plugin) │ ○ Nextcloud Talk (self-hosted) │ ○ Matrix (plugin) │ ○ BlueBubbles (macOS app) │ ○ LINE (Messaging API) │ ○ Zalo (Bot API) │ ○ Zalo (Personal Account) │ ○ Tlon (Urbit) │ ● Finished └选择之后会安装对应的扩展回车就行了◆ Install Feishu plugin? │ ● Download from npm (openclaw/feishu) │ ○ Skip for now └如果出现下面的错误一般都是由于你之前安装过了需要删除扩展[plugins] feishu failed to load from /home/ubuntu/.openclaw/extensions/feishu/index.ts: Error: Cannot find module zod Require stack: - /home/ubuntu/.openclaw/extensions/feishu/src/config-schema.ts先退出安装飞书先安装zod输入npm install -g zod # 删除飞书扩展一般都是由于你之前安装过了 rm -rf ~/.openclaw/extensions/feishu如果没有错误的话选择飞书通道之后应该是下面的输出Select a channel │ Feishu/Lark (飞书) │ ◇ Feishu credentials ──────────────────────────────────────────────────────────────╮ │ │ │ 1) Go to Feishu Open Platform (open.feishu.cn) │ │ 2) Create a self-built app │ │ 3) Get App ID and App Secret from Credentials page │ │ 4) Enable required permissions: im:message, im:chat, contact:user.base:readonly │ │ 5) Publish the app or add it to a test group │ │ Tip: you can also set FEISHU_APP_ID / FEISHU_APP_SECRET env vars. │ │ Docs: feishu │ │ │ ├───────────────────────────────────────────────────────────────────────────────────╯ │ ◆ Enter Feishu App ID │ _ # 输入 App ID └先不着急输出我们先登录飞书开放平台 https://open.feishu.cn点击「开发者后台 - 创建企业自建应用」如下图然后点击创建应用如下创建完成后首先到凭据管理中获取 App ID 和 App Secret注意保存后续配置需要使用。然后添加机器人如下操作首先配置个名字配置 OpenClaw 飞书参数拿到 App ID 和 App Secret 之后在刚才的上面的输入填入 APP ID 和 App Secret最后◇ Enter Feishu App ID │ cli_a9xxxxxxxf85cb2 # 填入你自己的 App ID │ ◇ Enter Feishu App Secret │ WmO1Hj1qkxxxxxxxxxxxihYL5NxXyTDt # 填入你自己的 App Secret [info]: [ client ready ] │ ◇ Feishu connection test ───────────────────────────╮ │ │ │ Connected as ou_3ef555cb1axxxxxxxxeb6203805ba9ee │ │ │ ├────────────────────────────────────────────────────╯ │ ◆ Which Feishu domain? │ ● Feishu (feishu.cn) - China # 选择国内 │ ○ Lark (larksuite.com) - International ◆ Group chat policy │ ○ Allowlist - only respond in specific groups # 允许列表 需要配置 │ ● Open - respond in all groups (requires mention) # 这里全部放开就行了 │ ○ Disabled - dont respond in groups ◆ Select a channel │ ○ Telegram (Bot API) │ ○ WhatsApp (QR link) │ ○ Discord (Bot API) │ ○ Google Chat (Chat API) │ ○ Slack (Socket Mode) │ ○ Signal (signal-cli) │ ○ iMessage (imsg) │ ○ Feishu/Lark (飞书) │ ○ Nostr (NIP-04 DMs) │ ○ Microsoft Teams (Bot Framework) │ ○ Mattermost (plugin) │ ○ Nextcloud Talk (self-hosted) │ ○ Matrix (plugin) │ ○ BlueBubbles (macOS app) │ ○ LINE (Messaging API) │ ○ Zalo (Bot API) │ ○ Zalo (Personal Account) │ ○ Tlon (Urbit) │ ● Finished (Done) # 选择完成完成之后会继续让你选择访问策略◇ Configure DM access policies now? (default: pairing) # │ Yes │ ◇ Feishu DM access ─────────────────────────────────────────────────────────────────────────╮ │ │ │ Default: pairing (unknown DMs get a pairing code). │ │ Approve: openclaw pairing approve feishu code │ │ Allowlist DMs: channels.feishu.dmPolicyallowlist channels.feishu.allowFrom entries. │ │ Public DMs: channels.feishu.dmPolicyopen channels.feishu.allowFrom includes *. │ │ Multi-user DMs: set session.dmScopeper-channel-peer (or per-account-channel-peer │ │ for multi-account channels) to isolate sessions. │ │ Docs: start/pairing │ │ │ ├────────────────────────────────────────────────────────────────────────────────────────────╯ │ ◇ Feishu DM policy │ Open (public inbound DMs) # 公开 │ ◇ Add display names for these accounts? (optional) │ No # 不需要 │ └ Channels updated.你可以通过~/.openclaw/openclaw.json查看对应的 channel 配置最后配置如下{ channels: { feishu: { enabled: true, appId: xxxxxxxxxxxxxxxxxxxxxxxxxxx, appSecret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, domain: feishu, groupPolicy: open, dmPolicy: open, allowFrom: [ * ] } } }配置完成之后重启openclaw gateway restart重启完成后回到飞书找到「事件和回调」选择长连接模式如下图如果配置成功说明连接已建立。继续下面的配置添加事件选择「接收消息」事件事件添加完成之后还需要开通权限有以下权限全部勾选权限Scope范围Description说明contact:user.base:readonly用户信息获取基础用户信息im:message消息 全部勾选发送和接收消息如下图以上步骤全部完成后即可与机器人对话。但在此之前需要先创建一个版本注意每次修改配置后都需要重新发布版本建议全部配置完成后再统一发布。发布完成后回到飞书客户端可以看到应用已上线点击打开应用向机器人发送Hello即可收到 Moltbot 的回复OpenClaw 常用命令速查安装完成后以下是日常使用中最常用的 OpenClaw 命令命令功能openclaw status查看 OpenClaw 运行状态openclaw onboard重新进入配置向导openclaw gateway start启动服务openclaw gateway stop停止服务openclaw gateway restart重启服务openclaw update更新到最新版本openclaw health健康检查openclaw doctor诊断问题openclaw dashboard获取 Web UI 访问链接openclaw security audit --deep安全审计openclaw uninstall卸载 OpenClawOpenClaw 成本说明与免费模型推荐OpenClaw 本身完全免费开源主要成本来自两个方面服务器成本一台最低配置的云服务器即可AI 模型 API 调用费用各模型服务商的免费额度和计费模式不同以下是常见选择模型服务商免费额度适合场景通义千问Qwen免费额度充足本教程推荐入门首选小米 MiMo有免费试用额度成本敏感用户KIMI (Moonshot)有免费额度中文理解能力强GLM 4.7 (Z.AI)有免费额度性价比高OpenAI GPT付费英文场景最佳Anthropic Claude付费代码能力最强对于刚接触 OpenClaw 的用户建议先用通义千问的免费额度体验熟练后再根据实际需求选择其他模型。总结
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2448702.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!