AI创想

标题: openclaw helloworld 20260304 [打印本页]

作者: AI小编    时间: 3 天前
标题: openclaw helloworld 20260304
作者:CSDN博客
看了很多帖子,关注点都不一样,操作系统(Windows/macos/linux)、各种软件和依赖版本(openclaw,飞书插件,nodejs)、安装方式(curl, npm, pnpm)等,还得自己踩一遍坑,记录一下。。。
0. 准备

环境:macos,node.js, npm, git等都满足要求了;
1. 安装openclaw
  1. sudonpminstall-g openclaw@latest
复制代码
2. 初始化openclaw
  1. openclaw onboard --install-daemon # 加sudo或者切root都会报错
复制代码
出来的交互配置选择:
  1. I understand this is personal-by-default and shared/multi-user use requires
  2. lock-down. Continue?: Yes
  3. Onboarding mode: QuickStart
  4. Config handling: Update values
  5. Model/auth provider: Z.AI
  6. 按提示输入api_key
  7. Default model: keep current
  8. select channel: skip for now
  9. configure skills now?: no
  10. Enable hooks: Skip for now
  11. How do you want to hatch your bot?: Hatch in TUI
复制代码
就可以了,在终端可以跟openclaw对话了。
3. 创建飞书机器人

这步简单,去飞书开放平台操作一下:https://open.feishu.cn/
  1. {"scopes":{"tenant":["contact:user.base:readonly","im:chat:readonly","im:message","im:message.group_at_msg:readonly","im:message.p2p_msg:readonly","im:message:recall","im:message:send_as_bot","im:message:send_multi_depts","im:message:send_multi_users","im:message:send_sys_msg","im:message:update","im:resource"],"user":[]}}
复制代码
4. 安装飞书插件

https://github.com/m1heng/clawdbot-feishu
  1. openclaw plugins install @m1heng-clawd/feishu
  2. # 会出现‘npm install failed’,依赖安装失败,因为权限不足cd ~/.openclaw/extensions/feishu
  3. sudopnpminstall# 安装依赖# 也可以直接sudo openclaw plugins install @m1heng-clawd/feishu,没试过
复制代码
5. 飞书插件配置
  1. openclaw config set channels.feishu.appId "<App_ID>"
  2. openclaw config set channels.feishu.appSecret "<App_Secret>"
  3. openclaw config set channels.feishu.enabled true
  4. openclaw config set channels.feishu.connectionMode websocket
  5. openclaw config set channels.feishu.dmPolicy pairing # 或直接open
  6. openclaw config set channels.feishu.groupPolicy allowlist
  7. openclaw config set channels.feishu.requireMention true
复制代码
重启:openclaw gateway restart(每次更改openclaw配置都需重启)
6. 飞书机器人事件与回调配置

(, 下载次数: 0)


7. 飞书内测试

8. 问题: openclaw无法更新记忆文件

openclaw初始化时没有设定相关tool能力,我试过手动在配置文件openclaw.json中修改tools,但好像不行:
  1. {tools:{profile:"messaging",allow:["group:fs"]// 增加文件相关操作,直接在配置文件中修改,好像是不行的。},}
复制代码
可能还需要在其他地方进行配置?先简单粗暴用命令行进行无限制配置:
  1. openclaw config set tools.profile "full"
复制代码
这下就能把聊天相关的记忆存下来了。

(, 下载次数: 0)


9. 其他内置技能

10. clawhub

扩展技能,上clawhub,先试一个搜索skill
11. todo

参考文档

OpenClaw 到底怎么装?一篇纯小白也能成功部署的超详细教程
github | docs
飞书插件

原文地址:https://blog.csdn.net/dragonchow123/article/details/158655271




欢迎光临 AI创想 (https://llms-ai.com/) Powered by Discuz! X3.4