2026年OpenClaw从新手到中级完整教程

OpenClaw从新手到中级完整教程OpenClaw 曾用名 ClawdBot Moltbot 是 2026 年最火的开源 AI Agent 项目 GitHub 已获得超过 242 000 星标 它不是普通的聊天机器人 而像是一个 的 AI 智能体平台 Agent Platform 让你能在自己的电脑上运行 AI 助理 并把它接入到你日常使用的工具里 比如飞书 Discord 1 Gateway 网关 Gateway 是

大家好,我是讯享网,很高兴认识大家。这里提供最前沿的Ai技术和互联网信息。



OpenClaw(曾用名 ClawdBot/Moltbot)是 2026 年最火的开源 AI Agent 项目,GitHub 已获得超过 242,000 星标。


它不是普通的聊天机器人,而像是一个的AI智能体平台(Agent Platform)让你能在自己的电脑上运行AI助理,并把它接入到你日常使用的工具里——比如飞书、Discord。


GPT plus 代充 只需 145


1、Gateway(网关)


Gateway 是 OpenClaw 与外部世界交互的桥梁:


  • 消息路由:将 IM(微信、Telegram、Discord 等)消息转发给对应的 Agent 处理
  • 结果回复:将 Agent 的响应发送回原始 IM 渠道
  • 多渠道支持:同时接入多个 IM 平台,统一管理


2、Agent(智能体)


Agent 是处理任务的实体:


  • 会话管理:维护对话上下文,支持多轮对话
  • 任务执行:调用 Skills 和工具完成用户请求
  • 记忆机制:通过记忆系统保持长期上下文


3、Skills(技能)


Skills 是 OpenClaw 的能力扩展,类似于”插件”或”应用”:


  • 模块化设计:每个 Skill 定义一组特定任务
  • 生态丰富:可从 ClawHub 安装第三方 Skills
  • 自定义开发:支持编写自定义 Skills 扩展能力
  • 典型 Skills:GitHub、Weather、Coding Agent 等


4、Channel(频道)


Channel 定义了消息的输入/输出渠道:


  • 多平台接入:支持 Telegram、Discord、WhatsApp、Feishu、Signal 等
  • 配置灵活:每个 Channel 可独立配置机器人行为
  • 消息格式:处理不同平台的消息格式差异


在终端,粘贴下面命令安装 openclaw:

npm install -g openclaw@latest

GPT plus 代充 只需 145

安装完成后,执行以下命令,然后按照引导对openclaw进行初始化设置:

讯享网openclaw onboard –install-daemon

选择 QuickStart 快速开始配置:



AI模型供应商选择, 这里我选择 MiniMax:



认证方式选择:MiniMax M2.5(CN),意思是国内版本,通过API Key 方式做认证:



接着按提示输入Key,回车确认。



Channel 选择,暂时跳过,后面单独介绍接入飞书和Discord:



Skill 和Hooks 也先跳过,暂时先不配置:



然后选择的Web UI打开 OpenClaw Web 端:



随后会在浏览器打开 http://127.0.0.1:18789


这个就是 OpenClaw Web 端,后面也可以通过 openclaw dashboard 命令来打开


1、创建飞书应用


https://open.feishu.cn/app


打开飞书开放平台, 创建新的应用: OpenClaw

创建完成记录下 App ID 和 App Secret 备用:



2、 OpenClaw添加飞书channel


使用命令:openclaw plugins enable feishu 开启 OpenClaw 内置的飞书插件,默认是disable 状态,loaded 为开启。



使用 openclaw channels add 命令配置channel。


选择 Feishu/Lark (飞书):



按提示输入创建飞书应用时保存的App ID 和App Secret:



群聊策略选择 Open:允许响应所有的群聊,Allowlist: 在白名单的群聊可以响应。



选择 Finished, 然后按提示完成配置即可。



Web 端 Channels 页可以看到飞书是 Running 状态, 就是配置好了。



3、 配置飞书应用机器人能力与消息权限 


编辑上面创建的飞书应用


  • 为应用开启机器人能力



  • 为应用开通相关权限



  • 批量导入下方权限


 
   
    
    
讯享网{  “scopes”: {    “tenant”: [      “cardkit:card:write”,      “contact:contact.base:readonly”,      “contact:user.base:readonly”,      “im:chat:readonly”,      “im:message”,      “im:message.group_at_msg:readonly”,      “im:message.group_msg”,      “im:message.p2p_msg:readonly”,      “im:message.reactions:read”,      “im:message:readonly”,      “im:message:recall”,      “im:message:send_as_bot”,      “im:message:update”,      “im:resource”    ],    “user”: [      “contact:contact.base:readonly”    ]  }}

  • 为应用订阅相关事件



订阅方式选默认推荐的 长连接,添加上以下事件



⚠️第3步中的订阅事件的操作一定要在第2步 接入飞书channel之后,否则选长连接会失败。


编辑完之后记得创建版本并发布才能生效。


4、接入飞书群聊


用手机或者电脑打开飞书客户端,创建一个测试群:



将机器人拉入群聊:



@OpenClaw 打个招呼:



OpenClaw  可以正常回复就说明飞书接入成功了。

1、新建 discord 应用


https://discord.com/developers/applications


打开Discord 开发者平台,新建应用:OpenClaw



Bot 页面开启下面3个配置项,然后复制Token 备用:




OAuth2 页面开启必要的权限后,拷贝生成的URL:





2、新建Discord Server 并加入Bot


新建Discord 的Server:



将创建的Bot 加到 Server , 拷贝上面复制的URL 到浏览器打开,点击‘Continue’:



3、OpenClaw添加Discord channel


使用 openclaw channels add 命令配置channel。


选择 Discord (Bot API):



按提示输入Token:



Discord channel策略选择 Open:允许响应所有的channel,Allowlist: 在白名单的channel可以响应:



选择 Finished, 然后按提示完成配置即可。


在 OpenClaw 中,一个 Agent 不只是一个名字,它是一个独立的“虚拟员工”,拥有自己的各个组成部分,包括:


  • Workspace (工作区):它的个人办公室(”灵魂三件套”、长期记忆)
  • AgentDir (状态目录):它的身份证(认证信息、模型配置)
  • Sessions (会话存储):它的私人记忆(独立的聊天记录,不跟别人串味)


1、SOUL.md — AI 的灵魂


定义 AI 的性格和行为准则:


  • Core Truths — 核心原则(不说废话、有观点、谨慎使用外部工具)
  • Vibe — 风格定位(不像机器人,像真实助手)
  • Boundaries — 边界(隐私保护、谨慎对外)


2、USER.md — 用户画像


记录关于用户的信息:


  • 姓名、称呼、时区
  • 偏好、项目、痛点
  • 随对话不断更新


3、AGENTS.md — 工作规范


定义工作方式和记忆机制:


  • 每次会话必读:SOUL.md → USER.md → memory/
  • 写作规范:TEXT > BRAIN(随时记录)
  • 心跳任务:定期检查 + 主动汇报
  • 群聊礼仪:知道何时说话、何时沉默


通过调整 workspace 下的这3个文件,就可以将Agent 从”通用 AI”变成”你的专属AI”。


step1: 新建多个agent


Openclaw 默认是单 agent 模式,可以通过下面命令新建 agent:


openclaw agents add coder 


step2: 创建多个Bot


按着上面 新建 discord 应用 的操作创建多个Bot 并加入到Server



step3: 将Bot 与Agent 绑定


通过bindings 为每个agent 绑定一个Bot , 下面是discord 的配置示例:


讯享网 
   
    
    
{&nbsp;&nbsp;“bindings”: [&nbsp; &nbsp; {&nbsp; &nbsp; &nbsp;&nbsp;“agentId”:&nbsp;“main”,&nbsp; &nbsp; &nbsp;&nbsp;“match”: {&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;“channel”:&nbsp;“discord”,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;“accountId”:&nbsp;“main”&nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; },&nbsp; &nbsp; {&nbsp; &nbsp; &nbsp;&nbsp;“agentId”:&nbsp;“coder”,&nbsp; &nbsp; &nbsp;&nbsp;“match”: {&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;“channel”:&nbsp;“discord”,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;“accountId”:&nbsp;“coder”&nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; }&nbsp; ],&nbsp;&nbsp;“channels”: {&nbsp; &nbsp;&nbsp;“discord”: {&nbsp; &nbsp; &nbsp;&nbsp;“enabled”:&nbsp;true,&nbsp; &nbsp; &nbsp;&nbsp;“allowBots”:&nbsp;true,&nbsp; &nbsp; &nbsp;&nbsp;“groupPolicy”:&nbsp;“allowlist”,&nbsp; &nbsp; &nbsp;&nbsp;“accounts”: {&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;“main”: {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;“token”:&nbsp;\({DISCORD_BOT_TOKEN_1}</span></span><span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"</span>,</span></code><code mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span leaf="" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"groupPolicy"</span>:&nbsp;<span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"allowlist"</span>,</span></code><code mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span leaf="" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"guilds"</span>: {</span></code><code mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span leaf="" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"</span><span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span class="code-snippet__variable" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">\){SERVER_ID}: {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;“requireMention”:&nbsp;true,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;“users”: [&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\({USER_ID}</span></span><span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"</span></span></code><code mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span leaf="" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ],</span></code><code mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span leaf="" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"channels"</span>: {</span></code><code mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span leaf="" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"</span><span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span class="code-snippet__variable" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">\){CHANNEL_ID}: {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;“allow”:&nbsp;true&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;“coder”: {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;“token”:&nbsp;\({DISCORD_BOT_TOKEN_2}</span></span><span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"</span>,</span></code><code mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span leaf="" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"groupPolicy"</span>:&nbsp;<span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"allowlist"</span>,</span></code><code mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span leaf="" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"guilds"</span>: {</span></code><code mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span leaf="" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"</span><span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span class="code-snippet__variable" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">\){SERVER_ID}: {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;“requireMention”:&nbsp;true,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;“users”: [&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\({USER_ID}</span></span><span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"</span></span></code><code mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span leaf="" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ],</span></code><code mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span leaf="" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"channels"</span>: {</span></code><code mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span leaf="" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">"</span><span class="code-snippet__string" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;"><span class="code-snippet__variable" mp-original-font-size="14" mp-original-line-height="1.28572" style="font-size: 14px; line-height: 1.85714;">\){CHANNEL_ID}: {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;“allow”:&nbsp;true&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; }&nbsp; }}

Tips: 手动修改配置文件容易出错,可以直接将这个丢给OpenClaw 让它给配置。


ClawHub&nbsp;是 OpenClaw 的官方插件市场,提供丰富的 Skills 扩展。它的访问地址如下:


另外clawhub 也提供了命令行工具用来搜索/安装SKill,使用下方命令进行安装


npm install -g clawhub


  • 搜索 Skills


clawhub search &lt;关键词&gt;



  • 安装指定的 Skill


clawhub install &lt;skill-name&gt;



通过 openclaw skills list 命令可以查看当前安装的skills 情况,绿色ready状态的Skill 就是可用的


案例1: 操作浏览器


在飞书聊天框&nbsp;@OpenClaw 打开浏览器,用Google 搜索下‘openclaw’



OpenClaw 会自动打开你的浏览器进行操作



案例2: 每日新闻


@OpenClaw 每天18:10分给我一个关于Ai 的新闻简报



案例3: 自动审查&nbsp;GitHub&nbsp;的PR


@OpenClaw &nbsp;帮我审查下这个项目的PR&nbsp;&lt;github&nbsp;rep&gt;



通过&nbsp;Heartbeat 可以让OpenClaw 自动审查PR


在此,我们挑选了一些社区分享的案例供大家参考尝试。如需探索更多应用场景,访问这个 GitHub 仓库:


https://github.com/hesamsheikh/awesome-openclaw-usecases


案例1:自定义早间简报


每天在固定时间(如早上 8:00)通过 Telegram、Discord 或 iMessage 发送一份结构化的简报,内容涵盖:


  • 定制新闻:&nbsp;自动搜索并总结你感兴趣的领域(如 AI、创业、技术)的隔夜动态。
  • 任务梳理:&nbsp;从 Todoist 或 Apple Reminders 等工具中提取当天的待办事项。
  • 深度产出:&nbsp;不只是给灵感,而是直接写出完整的脚本、邮件草案或方案,让你“醒来时工作已经做了一半”。
  • 主动建议:&nbsp;AI 会提议它当天可以帮你自动完成哪些任务


案例2: &nbsp;Reddit 每日摘要


Cron 自动化任务,帮你高效筛选并阅读感兴趣的内容:


  • 自动汇总:&nbsp;每天获取你最喜欢的 Subreddit(版块)中表现最好的帖子。
  • 深度搜索:&nbsp;按主题搜索帖子或提取评论列表,获取更多背景信息。
  • 建立清单:&nbsp;帮你把想看的、想回复的内容整理成短列表,方便稍后处理


案例3:项目状态管理系统


用事件驱动的逻辑来取代传统的看板(如 Kanban 或 Trello),解决项目管理中手动更新滞后、背景信息丢失的问题


  • 告别手动:&nbsp;不再手动挪动看板卡片(Kanban),直接对 AI 说“XX 做完了”或“YY 卡住了”。
  • 自动更新:&nbsp;AI 自动修改数据库状态,并同步关联你的 GitHub 代码提交记录。
  • 随时追溯:&nbsp;像问同事一样问 AI:“那个功能进度如何?”或“为什么当时改了方案?”,它会根据历史记录直接回答


站在 2026 年初的起点,OpenClaw 不仅仅是一个工具,它是您与 AI 时代共同进化的数字资产。


1. 自动进化的“大脑”


随着底层模型(Claude、GPT)的持续迭代,您的 OpenClaw 助手在无需更改配置的情况下,理解力与执行力将自动升级。它会越用越聪明,犯错越来越少。


2. 从文字到全感官的跨越


未来的 OpenClaw 将普及多模态交互:


  • 看与听:&nbsp;实时分析摄像头画面,支持自然的语音对话。
  • 动:&nbsp;不再止于屏幕,而是能控制外部设备执行物理世界的任务。


3. Agent 协作网络


未来您拥有的将是一个“数字团队”。OpenClaw 作为核心“管家”,协调多个专项 Agent(写代码、管邮件、做分析)各司其职,而您只需发号施令。


4. 越早开始,优势越大


技术可以买到,但“记忆”不能。&nbsp;今天搭建的助手,每一天都在积累关于您的工作习惯、项目状态和处理偏好。一个使用了半年的助手,其核心价值在于那 6 个月的认知积累这种先发优势,是任何新工具都无法瞬间替代的。


正在看这篇文章的朋友,你有在使用OpenClaw吗? 你用OpenClaw做了哪些有意思的东西呢?欢迎评论区一起讨论!


&lt; END &gt;


最近小灰创建了一个 AI副业交流群,对AI副业变现感兴趣的朋友,都欢迎进**流。扫码添加小灰微信,备注“ai“即可进群
图片

小讯
上一篇 2026-03-11 09:40
下一篇 2026-03-11 09:42

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/212555.html