开启左侧

OpenClaw安装

[复制链接]
作者:风流 少年
一:安装

安装前需要先检查nodejs版本在22+。
  1. # macOS / Linux / WSL2:curl-fsSL https://openclaw.ai/install.sh |bash# Windows PowerShell
  2. iwr -useb https://openclaw.ai/install.ps1 | iex
复制代码
如果通过上述安装失败也可以通过npm安装,安装过程中会需要其它依赖,如果报错可以直接DeepSeek问一下。
  1. npminstall-g openclaw@latest
复制代码
OpenClaw安装-1.png


检查是否安装成功:如果有显示OpenClaw相关内容则表示成功了。
OpenClaw安装-2.png


二:配置

配置1:是否选择个人模式

默认个人使用模式,选择Yes。
OpenClaw安装-3.png


配置2:配置模式

选择默认的快速开始 QuickStart。

OpenClaw安装-4.png


配置3:选择模型提供商

根据自己手里购买的模型厂商进行选择(如OpenAI、Anthropic/Google、Qwen、MiniMax等),这里我个人用小米的。

OpenClaw安装-5.png


配置4:选择现在粘贴API key

在小米外网上申请免费的API key https://platform.xiaomimimo.com/#/console/api-keys。

OpenClaw安装-6.png

OpenClaw安装-7.png


配置5:默认模型

根据问题3配置的模型提供商选择要使用的模型,因个人特殊选择小米模型,我这里手动输入,购买的其它模型选择即可。

OpenClaw安装-8.png

xiaomi/mimo-claw-0301

OpenClaw安装-9.png


配置6:channel

对于新手建议跳过选择最后一个Skip for now,有经验的可以选择飞书。

OpenClaw安装-10.png

OpenClaw安装-11.png

OpenClaw安装-12.png

进入飞书开放平台https://open.feishu.cn/,创建一个应用,应用名随便写(如“我的AI助手”),然后获取秘钥App Secert。

OpenClaw安装-13.png


OpenClaw安装-14.png

OpenClaw安装-15.png


需要在版本管理与发布中创建一个版本(版本号随便写如:1.0.0),然后再发布,发布之后状态为“已起用”,这样才能在飞书上搜索到。

OpenClaw安装-16.png

OpenClaw安装-17.png


飞书群组策略Group chat allowlist (chat_ids) ,直接选择Open。

OpenClaw安装-18.png

完整配置。

OpenClaw安装-19.png


配置7:搜索提供商

跳过 Skip for now。

OpenClaw安装-20.png


配置8:配置Skill

先不配置 No。

OpenClaw安装-21.png


配置9:是否开启Hooks

通过空格键space选择,都选上,可以全选或者跳过都行。

OpenClaw安装-22.png


配置10:选择机器人UI

选择Web UI。

OpenClaw安装-23.png

配置完整自动打开 http://127.0.0.1:18789/chat

OpenClaw安装-24.png

前面没有配置飞书的也可以在Web UI上进行配置。

OpenClaw安装-25.png

技能管理

OpenClaw安装-26.png


三:注意

如果某个步骤配置错了无法返回上一步重新配置,只能配置完成,或者重新开头配置。
  1. openclaw onboard
复制代码
如果所有配置已经完成,只想修改某个配置,可以单独进行配置,如单独配置频道channes。
  1. openclaw configure --section channels
复制代码
四:配对

    一文完全搞懂OpenClaw(Clawdbot)附飞书对接教程! https://www.feishu.cn/content/article/7602519239445974205
    OpenClaw飞书官方插件上线|一文讲清功能、安装更新教程与常见问题! https://www.feishu.cn/content/article/7613711414611463386
    在飞书开放平台创建一个自建应用,名字为“我的AI助手”在应用中“添加应用能力”,把机器人添加进来事件与回调:事件配置-订阅方式:使用 长连接接收事件,保存。

    OpenClaw安装-27.png

    保存后如报错:未检测到应用连接信息,请确保长连接建立成功后再保存配置 配置文档,按照如下名命令进行检查
  1. # 查看飞书配置状态:检查配置是否完成(appId、appSecret、enabled )
  2. openclaw config list |grep feishu
  3. # 配置应用(如果没有配置进行配置)
  4. openclaw config set channels.feishu.appId "这里替换为你的 App ID"
  5. openclaw config set channels.feishu.appSecret "这里替换为你的 App Secret"# 配置完后要重启网关
  6. openclaw gateway restart
  7. # 查看日志,确认连接是否成功
  8. openclaw logs follow
复制代码
    保存后再添加事件:im.message.receive_v1(接收消息事件)

    OpenClaw安装-28.png

    权限管理:导入

    OpenClaw安装-29.png

  1. {"scopes":{"tenant":["contact:contact.base:readonly","docx:document:readonly","im:chat:read","im:chat:update","im:message.group_at_msg:readonly","im:message.p2p_msg:readonly","im:message.pins:read","im:message.pins:write_only","im:message.reactions:read","im:message.reactions:write_only","im:message:readonly","im:message:recall","im:message:send_as_bot","im:message:send_multi_users","im:message:send_sys_msg","im:message:update","im:resource","application:application:self_manage","cardkit:card:write","cardkit:card:read"],"user":["contact:user.employee_id:readonly","offline_access","base:app:copy","base:field:create","base:field:delete","base:field:read","base:field:update","base:record:create","base:record:delete","base:record:retrieve","base:record:update","base:table:create","base:table:delete","base:table:read","base:table:update","base:view:read","base:view:write_only","base:app:create","base:app:update","base:app:read","board:whiteboard:node:create","board:whiteboard:node:read","calendar:calendar:read","calendar:calendar.event:create","calendar:calendar.event:delete","calendar:calendar.event:read","calendar:calendar.event:reply","calendar:calendar.event:update","calendar:calendar.free_busy:read","contact:contact.base:readonly","contact:user.base:readonly","contact:user:search","docs:document.comment:create","docs:document.comment:read","docs:document.comment:update","docs:document.media:download","docs:document:copy","docx:document:create","docx:document:readonly","docx:document:write_only","drive:drive.metadata:readonly","drive:file:download","drive:file:upload","im:chat.members:read","im:chat:read","im:message","im:message.group_msg:get_as_user","im:message.p2p_msg:get_as_user","im:message:readonly","search:docs:read","search:message","space:document:delete","space:document:move","space:document:retrieve","task:comment:read","task:comment:write","task:task:read","task:task:write","task:task:writeonly","task:tasklist:read","task:tasklist:write","wiki:node:copy","wiki:node:create","wiki:node:move","wiki:node:read","wiki:node:retrieve","wiki:space:read","wiki:space:retrieve","wiki:space:write_only"]}}
复制代码
    最后是版本管理与发布:发布一个新版本,可用范围为所有员工,发布。
在飞书app中搜索你创建的应用名字,如“我的AI助手”。

OpenClaw安装-30.png

OpenClaw安装-31.png

7. 像“我的AI助手”发送“你好”,如果机器人回复配对码更好,不回复使用命令获取

OpenClaw安装-32.png

  1. # 查看配对码Code(如SF9UUXWX)
  2. openclaw pairing list feishu
  3. # 配对
  4. openclaw pairing approve feishu 你的配对码
  5. # 重启
  6. openclaw gateway restart
复制代码
    打开机器人“我的AI助手”,发送一个消息,最终收到OpenClaw的回复。

    OpenClaw安装-33.png

五:常用命令

~/.openclaw/openclaw.json
  1. # 启动初始化向导
  2. openclaw onboard --install-daemon
  3. # 查看 OpenClaw 服务的运行状态
  4. openclaw status
  5. # 启动服务:配置完成后,启动 OpenClaw 的后台服务:
  6. openclaw start
  7. # 打开管理面板:服务启动后,在浏览器中打开管理面板,你将在这里看到一个非常直观的对话界面
  8. openclaw dashboard
  9. # 查看所有已配置的聊天渠道及其状态
  10. openclaw channels list
  11. # 切换 AI 模型(例如切换到更擅长编程的模型)
  12. openclaw models set<模型名称># 遇到问题时,让 OpenClaw 自我诊断并尝试自动修复
  13. openclaw doctor --fix# 安装“技能应用商店”
  14. npx skills add find-skills
  15. # 搜索技能
  16. find-skills search 文件整理
  17. # 安装飞书插件
  18. openclaw plugins install @m1heng-clawd/feishu
  19. openclaw config set channels.feishu.appId "这里替换为你的 App ID"
  20. openclaw config set channels.feishu.appSecret "这里替换为你的 App Secret"# 查看飞书配置状态(appId、appSecret、enabled )
  21. openclaw config list |grep feishu
  22. # 配置完后要重启网关(常用)
  23. openclaw gateway restart
  24. # 查看日志,确认连接是否成功,成功应该有如下显示# feishu ws connected# connected to wss://xxxxx# feishu provider ready
  25. openclaw logs --follow# 配对(向机器人发个“你好”就会收到一个配对码)
  26. openclaw pairing approve feishu 你的配对码
复制代码
原文地址:https://blog.csdn.net/vbirdbest/article/details/158810750
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

发布主题
阅读排行更多+

Powered by Discuz! X3.4© 2001-2013 Discuz Team.( 京ICP备17022993号-3 )