Back to search
awesome-openclaw-tutorial
SkillWorks with CodexGitHub
OpenClaw 中文教程(4500+ Star · 已出版纸质书):安装、配置、Skills、飞书接入与避坑|作者的 GPT-6 / Codex / Claude Code 新项目见 README 顶部
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Checked today
Badge for your README
Markdown
[](/listings/xianyu110--awesome-openclaw-tutorial)HTML
<a href="/listings/xianyu110--awesome-openclaw-tutorial"><img src="/api/listings/xianyu110--awesome-openclaw-tutorial/badge.svg" alt="findsafeskills safety rating" /></a>Install
i
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
README.md · README · 425 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
- # 🦞 Awesome OpenClaw Tutorial
- # 🦞 一本书玩转OpenClaw:超级个体实战指南
- > 从零开始打造你的AI工作助手:最全面的中文教程,涵盖安装、配置、实战案例和避坑指南
- [](https://github.com/xianyu110/awesome-openclaw-tutorial)
- [](https://github.com/xianyu110/awesome-openclaw-tutorial)
- [](LICENSE)
- [](https://github.com/xianyu110/awesome-openclaw-tutorial)
- [](reports/PROJECT-SUMMARY.md)
- [](https://blog.csdn.net/xianyu120)
- [](https://space.bilibili.com/399102586)
- [](https://upload.may.maynor1024.live/file/1773461955906_qrcode_for_gh_c749803541de_1280.jpg)
- [](https://www.youtube.com/@buguniao537)
- [](https://x.com/Nikitka_aktikiN)
- ## 🔥 2026 年 10 月 · 作者正在更新的新项目
- > OpenClaw 教程继续保留在下方 👇。这里先列出作者近期正在维护的新仓库,内容方向相近,欢迎顺手看看、点个 Star。
- | 预览 | 项目 | 一句话介绍 | Stars |
- |:---:|---|---|:---:|
- | <img src="https://raw.githubusercontent.com/xianyu110/awesome-gpt-6-astra/main/sources/martin/website/public/previews/cheerself-001.jpg" width="120" alt="GPT-6 Astra"> | [**awesome-gpt-6-astra**](https://github.com/xianyu110/awesome-gpt-6-astra) · [在线站](https://gpt-6-astra.cc/) | GPT-6 Astra 社区案例合集:游戏、3D、网页、Computer Use 等可玩 Demo,每条附作者与原帖 | [](https://github.com/xianyu110/awesome-gpt-6-astra) |
- | <img src="https://raw.githubusercontent.com/xianyu110/awesome-gpt-image2.5/main/assets/og-cover.png" width="120" alt="GPT Image 2.5"> | [**awesome-gpt-image2.5**](https://github.com/xianyu110/awesome-gpt-image2.5) · [画廊](https://xianyu110.github.io/awesome-gpt-image2.5/) | ChatGPT Images 2.5(Flare · Sunburst · Sketch)好玩用法画廊,可直接抄的 prompt 与评测 | [](https://github.com/xianyu110/awesome-gpt-image2.5) |
- | <img src="https://raw.githubusercontent.com/xianyu110/awesome-minimax-h3-prompts/main/assets/previews/cmsboram6001z04kzkda7f0i4.webp" width="120" alt="MiniMax H3"> | [**awesome-minimax-h3-prompts**](https://github.com/xianyu110/awesome-minimax-h3-prompts) · [在线浏览](https://tryminimax.asia/zh/minimax-h3-prompts) | MiniMax H3(海螺 3.0)视频提示词精选,每条配生成片段与作者署名 | [](https://github.com/xianyu110/awesome-minimax-h3-prompts) |
- | <img src="https://upload.maynor1024.live/file/1776480570690_img_048.png" width="120" alt="GPT Image 2"> | [**awesome-gptimage2**](https://github.com/xianyu110/awesome-gptimage2) · [在线站](https://awesome.gptimage2.asia/) | GPT Image 2 中文提示词实战手册:电商、海报、产品图等可复制的商业场景 prompt | [](https://github.com/xianyu110/awesome-gptimage2) |
- | | [**gpt-codex**](https://github.com/xianyu110/gpt-codex) · [教程站](https://codex.maynorai.top/) | 写给小白的 OpenAI Codex 中文教程:从 0 到 1 把 Codex 真正用起来 | [](https://github.com/xianyu110/gpt-codex) |
- | | [**awesome-codex-tutorial**](https://github.com/xianyu110/awesome-codex-tutorial) · [在线版](https://xianyu110.github.io/awesome-codex-tutorial/) | Codex 中文教程库:入门教程、系列图文教程、实战案例库与速查资料 | [](https://github.com/xianyu110/awesome-codex-tutorial) |
- | | [**awesome-claudcode-tutorial**](https://github.com/xianyu110/awesome-claudcode-tutorial) · [在线阅读](https://awesome.claude-opus.top/zh/) | 最全面的 Claude Code 中文教程,从零基础到企业级应用 | [](https://github.com/xianyu110/awesome-claudcode-tutorial) |
- > 🦞 以下为 OpenClaw 中文教程原有内容,持续保留并按版本校对。
- ---
- > 📖 **纸质书《OpenClaw超级个体实操手册》已上市!** 清华大学出版社出版,在开源教程基础上全面重写+逐条验证。🛒 [京东专属购买链接(¥42,原价¥59.8)](https://item.jd.com/14669463.html)
- > 🔄 **2026-09-10 更新说明**:本仓库当前按 **OpenClaw v2026.9.3(稳定版,2026-09-08 发布)** 校对;第 `1/2/5/7/8/10~15` 章已同步到 2026.9 主线。跨版本请先读 [`updates/2026-09-10-v2026.9.3.md`](updates/2026-09-10-v2026.9.3.md),升级后执行 `openclaw doctor --fix`。
- ## 📌 本教程与 OpenClaw 最新版差异说明
- 为了避免你把旧章节当成最新版官方教程,先看这 4 点:
- - **当前教程基线**:本仓库目前按 `v2026.9.3` 稳定版校对;如果 GitHub Releases 或 npm 出现更高版本,请以官方 Release Notes 和官方文档为准
- - **已优先更新的章节**:`README`、更新说明与第 `1/2/5/7/8/10~15` 章已按 `2026.9` 主线修订(含 2026.8 Breaking 迁移提示)
- - **仍含历史内容的章节**:第 `3/4/6/9` 章及部分 `tutorials/` 一键部署文仍可能含旧截图/旧渠道步骤,适合作为思路参考,不建议直接复制执行
- - **当前应优先使用的官方主线**:`openclaw onboard`、`openclaw models auth login --provider openai|…`、`openclaw doctor --fix`、`openclaw infer ...`、`openclaw skills …`、`Task Flow`、`Webhooks`、`/usage`
- | 类型 | 本教程当前状态 | 阅读建议 |
- |------|----------------|----------|
- | 版本基线 | 已对齐 `v2026.9.3` | 新手优先按这个版本跑通 |
- | 运行时 | Node **24.16+** 或 **26.1+**(推荐 26) | 先升 Node 再升 OpenClaw |
- | 跨版本迁移 | 强调 `openclaw doctor --fix` | 处理 `openai/*` 路由、OpenProse 清理、会话 SQLite |
- | 安装/配置主线 | 已补 2026.9 入口 | 优先看第 `2` 章和第 `11` 章 |
- | 媒体/创意能力 | 保留 `infer` / 媒体生成 / `ComfyUI` 主线 | 优先看第 `10` 章和第 `14` 章 |
- | 旧 Skill 生态 | 明确标为历史参考 | 用 `openclaw skills`,不要默认 `clawhub install …` |
- > ⚠️ **一句话判断**:如果你看到 `openai-codex/*`、`codex/*`、`/prose`、`local-anthropic`、`bananapro-image-gen`、整串 `clawhub install ...`,请先把它理解为“历史参考或需迁移项”,不要默认当成 `2026.9` 官方推荐步骤。
- ---
- ## 🚀 30秒快速选择:哪种部署方式适合你?
- | 你的情况 | 推荐方案 | 为什么 | 开始时间 |
- |---------|---------|------|---------|
- | **完全小白,想最快体验** | [**飞书妙搭**](tutorials/Openclaw史上最简单教程,小白一键部署.md#1飞书妙搭-openclaw--强烈推荐) ⭐ | **免费** + **1分钟完成** + **每日100万Tokens** | → 立即开始 |
- | **有服务器,想可视化管理** | [**宝塔面板**](tutorials/Openclaw史上最简单教程,小白一键部署.md#11宝塔面板-openclaw) | **免费插件** + **面板管理** + **一键安装** | → 3分钟搞定 |
- | **企业级,需要高安全性** | [**JVSClaw**](tutorials/Openclaw史上最简单教程,小白一键部署.md#10jvsclaw阿里云无影) | **14天免费** + **6核12GB** + **端到端加密** | → 需邀请码 |
- | **想用浏览器操控** | [Kimi Claw](tutorials/Openclaw史上最简单教程,小白一键部署.md#3kimi-openclaw) | **Kimi K2.5** + **浏览器控制** | → 200元/月 |
- | **量化交易/多IM** | [腾讯 WorkBuddy](tutorials/Openclaw史上最简单教程,小白一键部署.md#4腾讯-openclawworkbuddy) | **桌面端Agent** + **多IM支持** | → 送5000积分 |
- | **macOS原生体验** | [QClaw](tutorials/Openclaw史上最简单教程,小白一键部署.md#5qclaw) | **腾讯官方桌面客户端** + **全量公测** | → 免费 |
- | **Agent生态丰富** | [扣子 OpenClaw](tutorials/Openclaw史上最简单教程,小白一键部署.md#2扣子-openclaw) | **1800+Skills** | → 99元/月起 |
- 📖 **[查看完整一键部署教程 →](tutorials/Openclaw史上最简单教程,小白一键部署.md)**
- ---
- ## 📊 教程导航(按学习路径)
- ### 🎯 零基础入门(必读)
- - 📖 [第1章:认识OpenClaw](docs/01-basics/01-introduction.md) - 5分钟了解核心价值
- - 🚀 [第2章:快速部署](docs/01-basics/02-installation.md) - 选择适合你的部署方式
- - 💬 [第3章:快速上手](docs/01-basics/03-quick-start.md) - 发送第一条消息
- ### 🔥 核心功能(实战)
- - 📁 [第4章:文件管理](docs/02-core-features/04-file-management.md) - 效率提升81%
- - 🧠 [第5章:知识库](docs/02-core-features/05-knowledge-management.md) - 第二大脑系统 + Active Memory / Dreaming 补充
- - 📅 [第6章:日程管理](docs/02-core-features/06-schedule-management.md) - AI自动创建日程
- - ⚙️ [第7章:自动化](docs/02-core-features/07-automation-workflow.md) - 定时任务 + Task Flow / Webhooks 更新
- ### 💎 进阶技能(提升)
- - 🔌 [第8章:Skills扩展](docs/03-advanced/08-skills-extension.md) - 1800+技能
- - 🤖 [第9章:多平台集成](docs/03-advanced/09-multi-platform-integration.md) - 飞书/企微/钉钉/QQ/微信
- - 🔗 [第10章:API 与外部能力集成](docs/03-advanced/10-api-integration.md) - infer / webhooks / 媒体工作流
- - ⚙️ [第11章:高级配置](docs/03-advanced/11-advanced-configuration.md) - 模型 / 记忆 / 审批 / 性能
- ### 🎯 实战案例(直接套用)
- - 👔 [第12章:个人效率实战](docs/04-practical-cases/12-personal-productivity.md) - 知识工作 / 编程 / 创作 / 学习 / 个人运营
- - 🔗 [第13章:高级自动化](docs/04-practical-cases/13-advanced-automation.md) - cron / tasks / Task Flow / hooks / standing orders
- - 🎨 [第14章:创意应用](docs/04-practical-cases/14-creative-applications.md) - 图片 / 视频 / 音乐 / TTS / ComfyUI
- - 🚀 [第15章:一人公司实战](docs/04-practical-cases/15-solo-entrepreneur-cases.md) - 选题 / 交付 / 分发 / 复盘
- ### 📚 附录工具(速查)
- - [命令速查表](appendix/A-command-reference.md) | [必装Skills](appendix/B-skills-catalog.md)
- - [常见问题](appendix/E-common-problems.md) | [API对比](appendix/C-api-comparison.md)
- - [配置模板](appendix/H-config-templates.md) | [避坑指南](appendix/F-best-practices.md)
- ---
- ## 🆘 遇到问题?快速解决
- <details>
- <summary><b>🔧 常见问题速查(点击展开)</b></summary>
- ### 安装配置问题
- - [安装失败怎么办?](appendix/E-common-problems.md#安装配置问题)
- - [API连接失败?](appendix/E-common-problems.md#api连接问题)
- - [飞书Bot不回复?](docs/03-advanced/09-multi-platform-integration.md#常见问题)
- ### 使用问题
- - [AI变"哑巴"了?](#🔧-202632-版本ai变哑巴了) → 切换到 `full` profile
- - [Gateway启动失败?](appendix/E-common-problems.md#gateway问题) → 检查认证配置
- ### 成本优化
- - [API费用太高?](docs/03-advanced/11-advanced-configuration.md)
- - [如何省钱?](appendix/F-best-practices.md) - 使用国产模型节省95%
- </details>
- **找不到答案?**
- - 📖 [完整FAQ](appendix/E-common-problems.md)
- - 💬 [提交问题](https://github.com/xianyu110/awesome-openclaw-tutorial/issues)
- ---
- ## 🚨 重要版本提示
- ### ⚠️ 2026.3.7版本:Gateway认证要求(Breaking Change)
- Gateway认证现在**必须显式设置** `gateway.auth.mode`(`token` 或 `password`)
- **快速修复**:
- ```bash
- openclaw config set gateway.auth.mode token
- openclaw config set gateway.auth.token "your-secret-token"
- openclaw gateway restart
- ```
- ### 🔧 2026.3.2版本:AI变"哑巴"了?
- **症状**:只能聊天不能干活(文件管理、命令执行失效)
- **原因**:默认profile改为 `messaging`(纯聊天模式)
- **修复**:切换到 `full` profile
- ```bash
- openclaw config set tools.profile full
- openclaw gateway restart
- ```
- **5种Profile说明**:
- | Profile | 功能说明 |
- |---------|---------|
- | `messaging` | 只能发布消息、管理会话 |
- | `default` | 默认工具集(不含命令执行) |
- | `coding` | 编程相关工具 |
- | **`full`** | **完整工具集,包含命令执行(推荐)** |
- | `all` | 所有工具全开 |
- ---
- ### 🆕 v2026.3.12 重大更新(2026年3月)
- > 建议所有用户升级,包含大量安全修复
- **新功能**
- - **Control UI 全面重设计**:模块化 Dashboard,含概览/聊天/配置/Agent/Session 视图,支持命令面板、移动端底部 Tab、slash 命令、消息导出和消息置顶
- - **`/fast` 快速模式开关**:支持切换 OpenAI / Anthropic 的 fast tier,更省钱更快
- - **Kubernetes 支持**:新增 K8s 安装路径(支持 Kind 和 raw manifests)
- - **`sessions_yield` 工具**:Agent 可立即结束当前轮次并携带后续载荷,流程控制更灵活
- - **Slack Block Kit**:Slack 频道消息支持 Block Kit 富文本格式
- **重要安全修复**(建议立即升级)
- - 修复跨站 WebSocket 劫持路径
- - 修复 workspace plugin 隐式自动加载(防止恶意代码执行)
- - 修复 `/config`、`/debug` 权限绕过
- - 修复共享 token 范围自我提权
- - 多处 exec 审批绕过修复
- ---
- ### 🆕 v2026.3.13 更新(2026年3月中旬)
- **新功能**
- - **Chrome DevTools MCP attach 模式**:可直接连接已登录的 Chrome 浏览器进行自动化操作,无需重新登录
- - **Ollama 一键安装引导**:支持 Local 和 Cloud+Local 混合模式,本地模型更好用
- - **多模态记忆索引**:图片/音频内容可用 Gemini Embedding 进行语义检索
- - **Docker 时区支持**:新增 `OPENCLAW_TZ` 环境变量
- - **iOS 首次运行引导页**:新用户体验大幅提升
- **Bug 修复**
- - 修复工具密集型运行时 Dashboard UI 卡死/重渲染风暴
- - 修复 Windows 下 gateway 重启时弹出控制台黑窗口
- - 修复 setup code 可被重放攻击的安全漏洞
- - 插件 SDK 去重,修复约 2 倍内存膨胀问题
- ---
- ### 🆕 v2026.9.3 稳定版更新(2026年9月8日)
- **当前基线**
- - **稳定版**:`v2026.9.3`
- - **推荐运行时**:`Node 26`(或 `Node 24.16+`);**不再支持 Node 22**
- - **校验方式**:`npm view openclaw version` 应返回 `2026.9.3`
- - **完整跳变说明**:[`updates/2026-09-10-v2026.9.3.md`](updates/2026-09-10-v2026.9.3.md)
- **从 2026.6.8 跳到 2026.9.3,教学上最关键的变化**
- - **OpenClaw 2.0(2026.8.1)**:会话/转录迁入 SQLite;Control UI / onboarding 大改;升级前务必备份
- - **OpenAI 路由迁移**:`codex/*`、`openai-codex/*` → `openai/*`(`openclaw doctor --fix`)
- - **OpenProse 移除**:内置插件与 `/prose` 下线;清配置用 Doctor,需要时再装上游 Agent Skill
- - **Skills / Workshop**:优先 `openclaw skills`;Workshop 按 Agent 持久化;`clawhub install …` 降为历史参考
- - **更新恢复(2026.9.x)**:更新可预演、失败恢复更干净;关注 `openclaw update status`
- - **仍沿用的 2026.6 主线**:Active Memory / Memory Wiki、`infer`、Task Flow / Webhooks、媒体生成、`/usage`
- **升级命令**:
- ```bash
- # 先确认 Node
- node -v # 需要 24.16+ 或 26.1+
- openclaw update --tag 2026.9.3 --yes
- openclaw update repair
- openclaw doctor --fix
- openclaw --version # 确认版本为 2026.9.3
- ```
- > ⚠️ **新手建议**:目标是“按教程稳定跑通”就用 `v2026.9.3`。若 `openclaw update` 失败,可用 `npm install -g openclaw@2026.9.3 --allow-scripts=openclaw` 兜底。升级后先跑 `openclaw doctor --fix`、`openclaw models status --probe` 和 `openclaw channels status`。
- ### 📎 历史基线:v2026.6.8(2026年6月16日)
- > 以下内容保留为历史对照,**不再作为当前推荐基线**。
- - 当时推荐运行时多为 Node 24 / 兼容 Node 22.19+
- - 确立了 Active Memory、Dreaming、Memory Wiki、Task Flow、Webhooks、`openclaw infer`、内建媒体与 `/usage` footer 等主线
- - 若你的笔记/脚本仍写着 `openai-codex/*` 或整串 `clawhub install …`,请按上文迁移到 2026.9 主线
- ---
- ## 📖 纸质书:《OpenClaw超级个体实操手册》
- ⚠️ **当前说明**:开源教程的第 `1/2/5/7/8/10~15` 章已按 `v2026.9.3` 主线修订;纸质书仍然是更系统的重写版,适合需要完整、稳定、逐条验证内容的读者。
- **纸质书已全面修正,现已上市!**
- 清华大学出版社出版《OpenClaw超级个体实操手册》,在开源教程基础上做了**全面重写+逐条验证**:
- - 🔍 **144条CLI命令**对照官方文档逐条核对(教程中约60%已删除或修正)
- - ✅ **9套配置模板**全部在v2026.3.7+实际跑通
- - 🛡️ **新增安全防护指南** + 国产Claw全景指南
- - 📦 **7份随书附赠**电子资料
- 🛒 **购买链接**:[京东专属链接(¥42,原价¥59.8)](https://item.jd.com/14669463.html)
- 📦 **本地一键部署安装包**:[https://tryopenclaw.asia/](https://tryopenclaw.asia/)
- ---
- ### 📖 关于本教程
- ### 🎯 教程特色
- 1. **超级个体定位** - 一个人+OpenClaw=无限可能,效率提升10倍
- 2. **云端部署优先** - 降低技术门槛,手机随时使用
- 3. **国产模型为主** - 成本低、速度快、中文友好
- 4. **实战案例丰富** - 70+完整工作流,可直接应用
- 5. **中国本土化** - 企业微信/钉钉/飞书深度集成
- 6. **完整资源导航** - 官方资源、社区资源、学习路径
- ### 📊 教程规模
- - ✅ **15章节正文**:约267,000字
- - ✅ **15个附录**:约141,000字
- - ✅ **总字数**:408,000字
- - ✅ **70+实战案例**:可直接应用
- - ✅ **完整配图**:50+张配置截图
- ### 🎯 适合人群
- - 🚀 **超级个体**:想要一个人顶一个团队,实现个人价值最大化
- - 🔰 **完全新手**:从零开始,手把手教你安装配置
- - 💼 **知识工作者**:学习如何用OpenClaw提升10倍个人效率
- - 👨💻 **开发者**:深入了解Skills开发和API集成
- - ✍️ **内容创作者**:探索自动化工作流和高级应用
- ---
- ## 📚 完整教程目录
- ### 第一部分:零基础入门(3章节)
- - [第1章:OpenClaw是什么?](docs/01-basics/01-introduction.md)
- - [第2章:5分钟完成部署](docs/01-basics/02-installation.md)
- - [第3章:发送第一条消息](docs/01-basics/03-quick-start.md)
- ### 第二部分:核心功能(4章节)
- - [第4章:本地文件管理](docs/02-core-features/04-file-management.md)
- - [第5章:个人知识库](docs/02-core-features/05-knowledge-management.md)
- - [第6章:日程管理](docs/02-core-features/06-schedule-management.md)
- - [第7章:自动化工作流](docs/02-core-features/07-automation-workflow.md)
- ### 第三部分:进阶技能(4章节)
- - [第8章:Skills扩展](docs/03-advanced/08-skills-extension.md)
- - [第9章:多平台集成](docs/03-advanced/09-multi-platform-integration.md)
- - [第10章:API 与外部能力集成](docs/03-advanced/10-api-integration.md)
- - [第11章:高级配置(模型、记忆、审批与性能)](docs/03-advanced/11-advanced-configuration.md)
- ### 第四部分:实战案例(4章节)
- - [第12章:个人效率实战](docs/04-practical-cases/12-personal-productivity.md)
- - [第13章:高级自动化工作流](docs/04-practical-cases/13-advanced-automation.md)
- - [第14章:创意应用实战](docs/04-practical-cases/14-creative-applications.md)
- - [第15章:一人公司实战](docs/04-practical-cases/15-solo-entrepreneur-cases.md)
- ---
- ## 🔗 官方资源
- - **OpenClaw官方网站**:https://openclaw.ai
- - **OpenClaw官方文档**:https://docs.openclaw.ai
- - **GitHub仓库**:https://github.com/openclaw/openclaw
- - **ClawHub技能广场**:https://clawhub.ai
- - **Awesome Skills合集**:https://github.com/VoltAgent/awesome-openclaw-skills
- ## 💡 实战案例精选
- ### 📦 配置示例(开箱即用)
- - [基础配置](examples/configs/basic-config.json)
- - [多模型配置](examples/configs/multi-model-config.json)
- - [多Agent配置](examples/configs/multi-agent-config.json)
- - [飞书Bot配置](examples/configs/feishu-config.json)
- ### 🎬 实战场景
- - [文件管理:找发票](docs/02-core-features/04-file-management.md)
- - [知识管理:网页存档](docs/02-core-features/05-knowledge-management.md)
- - [日程管理:截图识别](docs/02-core-features/06-schedule-management.md)
- - [自动化:网站监控](docs/02-core-features/07-automation-workflow.md)
- ---
- ## 📊 成本对比
- | 方案 | 月费用 | 适用场景 |
- |------|--------|----------|
- | 飞书妙搭 | **免费** | 新手推荐(限时) |
- | 云端部署 | 20-50元 | 无Mac/24小时运行 |
- | 本地部署 | 0元 | 有Mac电脑 |
- | API费用(DeepSeek) | 5-30元 | 日常使用 |
- | API费用(Kimi) | 10-50元 | 长文档处理 |
- 💡 **省钱技巧**:使用国产大模型(DeepSeek、Kimi)节省**50%-70%**成本
- ---
- ## 🤝 贡献指南
- 欢迎贡献你的经验和案例!
- 1. Fork本仓库
- 2. 创建你的分支 (`git checkout -b feature/AmazingFeature`)
- 3. 提交你的修改 (`git commit -m 'Add some AmazingFeature'`)
- 4. 推送到分支 (`git push origin feature/AmazingFeature`)
- 5. 提交Pull Request
- ## 📮 联系方式
- ### 社交媒体
- - **GitHub**: [@xianyu110](https://github.com/xianyu110)
- - **CSDN专栏**: [OpenClaw从入门到精通](https://blog.csdn.net/xianyu120)
- - **B站**: [@MaynorAI](https://space.bilibili.com/399102586)
- - **YouTube**: [@buguniao537](https://www.youtube.com/@buguniao537)
- - **X (Twitter)**: [@Nikitka_aktikiN](https://x.com/Nikitka_aktikiN)
- ### 项目链接
- - **Clawbot项目**: [700+ Stars](https://github.com/xianyu110/clawbot)
- - **两万人AI社区主理人**
- ---
- ## 📈 项目进度
- - ✅ **v1.12**(2026-09-10):同步 OpenClaw `v2026.9.3`,覆盖 README / 安装升级 / 模型路由迁移 / Doctor / 关键章节基线,并新增 `updates/2026-09-10-v2026.9.3.md`
- - ✅ **v1.11**(2026-06-18):同步 OpenClaw `v2026.6.8` 稳定版,更新安装升级命令、版本基线、模型/渠道/usage/search 说明
- - ✅ **v1.10**(2026-04-16):第 `10~15` 章按 OpenClaw `v2026.4.14` 稳定版主线重写,并同步 README / 章节入口 / 纸书推荐文案
- - ✅ **v1.9**(2026-04-04):同步橙皮书 v1.3~v1.4 更新——新增微信ClawBot、腾讯全家桶、浏览器渠道、GLM-5-Turbo、安全漏洞统计
- - ✅ **v1.6**(2026-03-18):新增一键部署教程(8个平台)
- - 🔄 **后续**:继续清理第 `3/4/6/9` 章与 `tutorials/` 中的旧截图、旧渠道步骤
- ---
- ## 📄 许可证
- 本项目采用 [GPL-3.0 License](LICENSE)
- 
- ### ⚠️ 重要声明:禁止倒卖
- - ❌ **严禁倒卖**:禁止将本教程打包后进行商业售卖
- - ❌ **严禁闭源商用**:任何基于本项目的衍生作品必须同样开源
- - ✅ **允许学习**:欢迎个人学习和使用
- - ✅ **允许分享**:欢迎分享给更多需要的人
- - ✅ **允许修改**:可以修改并分享,但必须保持开源
- ---
- <div align="center">
- **最后更新**:2026年9月10日
- **教程版本**:v1.12
- **总字数**:408,000字(15章节 + 15附录)
- **适用OpenClaw版本**:2026.9.3(稳定版)
- 🎉 **教程已完成 | 支持续优化 | 完全免费** 🎉
- 🚀 **一个人 + OpenClaw = 无限可能** 🚀
- ⭐ **如果觉得有用,请给个Star支持一下** ⭐
- </div>
.claude/.skills/bananapro-image-gen/prepare-upload.sh · Bundled script · 182 lines · 1 finding marked
- #!/bin/bash
- # Banana Pro Image Gen Skill - 准备上传脚本
- set -e
- echo "🚀 准备上传 Banana Pro Image Generation Skill 到 skills.sh"
- echo "=================================================="
- echo ""
- # 1. 检查必需文件
- echo "📋 检查必需文件..."
- required_files=(
- "skill.json"
- "README.md"
- "SKILL.md"
- "requirements.txt"
- "scripts/generate_image.py"
- )
- for file in "${required_files[@]}"; do
- if [ -f "$file" ]; then
- echo " ✅ $file"
- else
- echo " ❌ $file - 缺失!"
- exit 1
- fi
- done
- echo ""
- # 2. 检查敏感信息
- echo "🔒 检查敏感信息..."
- if grep -r "sk-HoyC9xe8aB0CRC6j4EvuM0zRcN9TTYnIMjACMCeGvd95tuhQ" scripts/ 2>/dev/null; then
- Dismissed after review: Contains what looks like a hardcoded OpenAI API key
- Line 34 on GitHub
- echo " ⚠️ 警告:发现硬编码的 API Key!"
- echo " 请移除敏感信息后再上传"
- exit 1
- else
- echo " ✅ 未发现硬编码的敏感信息"
- fi
- echo ""
- # 3. 创建发布包
- echo "📦 创建发布包..."
- RELEASE_DIR="release"
- SKILL_NAME="bananapro-image-gen"
- # 清理旧的发布目录
- rm -rf "$RELEASE_DIR"
- mkdir -p "$RELEASE_DIR/$SKILL_NAME"
- # 复制文件
- cp -r scripts "$RELEASE_DIR/$SKILL_NAME/"
- cp skill.json "$RELEASE_DIR/$SKILL_NAME/"
- cp README.md "$RELEASE_DIR/$SKILL_NAME/"
- cp SKILL.md "$RELEASE_DIR/$SKILL_NAME/"
- cp requirements.txt "$RELEASE_DIR/$SKILL_NAME/"
- cp .gitignore "$RELEASE_DIR/$SKILL_NAME/"
- # 创建 LICENSE
- cat > "$RELEASE_DIR/$SKILL_NAME/LICENSE" << 'EOF'
- MIT License
- Copyright (c) 2026 xianyu110
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
- EOF
- echo " ✅ 发布包已创建:$RELEASE_DIR/$SKILL_NAME"
- echo ""
- # 4. 创建压缩包
- echo "📦 创建压缩包..."
- cd "$RELEASE_DIR"
- tar -czf "${SKILL_NAME}.tar.gz" "$SKILL_NAME"
- zip -r "${SKILL_NAME}.zip" "$SKILL_NAME" > /dev/null
- cd ..
- echo " ✅ ${SKILL_NAME}.tar.gz"
- echo " ✅ ${SKILL_NAME}.zip"
- echo ""
- # 5. 显示文件大小
- echo "📊 文件大小:"
- du -sh "$RELEASE_DIR/${SKILL_NAME}.tar.gz"
- du -sh "$RELEASE_DIR/${SKILL_NAME}.zip"
- echo ""
- # 6. 生成上传信息
- echo "📝 生成上传信息..."
- cat > "$RELEASE_DIR/UPLOAD_INFO.txt" << EOF
- Banana Pro Image Generation Skill - 上传信息
- ================================================
- Skill 名称: bananapro-image-gen
- 显示名称: Banana Pro Image Generation
- 版本: 1.0.0
- 作者: xianyu110
- 分类: Creativity
- 描述:
- 使用 Gemini 3 Pro Image 生成图片的 OpenClaw Skill,支持白板图、Logo设计、社交媒体配图等多种场景。
- 特点:
- - 支持中文提示词
- - 多种分辨率(1K/2K/4K)
- - 快速响应(10-30秒)
- - 成本低廉(\$0.04-0.16/张)
- 标签:
- ai, image-generation, gemini, creative, whiteboard, logo-design, text-to-image
- GitHub 仓库:
- https://github.com/xianyu110/awesome-openclaw-tutorial
- 文档链接:
- https://github.com/xianyu110/awesome-openclaw-tutorial/tree/main/.claude/.skills/bananapro-image-gen
- ================================================
- 上传步骤:
- 1. 访问 https://skills.sh/
- 2. 点击 "Submit a Skill" 或 "Add Skill"
- 3. 填写上述信息
- 4. 上传压缩包或提供 GitHub 链接
- 5. 提交审核
- 或者:
- 创建独立 GitHub 仓库:
- 1. 在 GitHub 创建新仓库:bananapro-image-gen-skill
- 2. 上传 release/$SKILL_NAME/ 目录下的所有文件
- 3. 在 skills.sh 提交 GitHub 链接
- ================================================
- EOF
- echo " ✅ UPLOAD_INFO.txt"
- echo ""
- # 7. 显示下一步
- echo "✅ 准备完成!"
- echo ""
- echo "📁 发布文件位置:"
- echo " $RELEASE_DIR/$SKILL_NAME/"
- echo ""
- echo "📦 压缩包:"
- echo " $RELEASE_DIR/${SKILL_NAME}.tar.gz"
- echo " $RELEASE_DIR/${SKILL_NAME}.zip"
- echo ""
- echo "📝 上传信息:"
- echo " $RELEASE_DIR/UPLOAD_INFO.txt"
- echo ""
- echo "🚀 下一步:"
- echo " 1. 查看 UPLOAD_GUIDE.md 了解详细上传步骤"
- echo " 2. 查看 $RELEASE_DIR/UPLOAD_INFO.txt 获取上传信息"
- echo " 3. 访问 https://skills.sh/ 提交你的 Skill"
- echo ""
- echo "💡 提示:"
- echo " - 可以直接上传压缩包"
- echo " - 或创建独立 GitHub 仓库后提交链接"
- echo " - 建议先在本地测试确保一切正常"
- echo ""
- echo "🎉 祝你的 Skill 发布成功!"
.claude/.skills/bananapro-image-gen/release/bananapro-image-gen/scripts/generate_image.py · Bundled script · 323 lines · 1 finding marked
- #!/usr/bin/env python3
- """
- 使用 Chat Completions 格式生成图片
- 适配 nextaicore API
- """
- import os
- import sys
- import json
- import base64
- import argparse
- import requests
- from pathlib import Path
- from datetime import datetime
- import re
- # API 配置
- # 请通过环境变量或命令行参数提供 API Key
- # export NEXTAI_API_KEY="your-api-key-here"
- DEFAULT_API_KEY = "" # 不要在代码中硬编码 API Key
- DEFAULT_BASE_URL = "https://tryallapi.com"
- DEFAULT_MODEL = "gemini-3-pro-image-preview"
- DEFAULT_API_FORMAT = "openai" # "openai" 或 "gemini"
- SUPPORTED_RESOLUTIONS = ["1K", "2K", "4K"]
- SUPPORTED_API_FORMATS = ["openai", "gemini"]
- def get_api_key(args_key=None):
- """获取API密钥"""
- if args_key:
- return args_key
- api_key = os.environ.get("NEXTAI_API_KEY")
- if api_key:
- return api_key
- # 如果没有提供 API Key,提示用户
- print("❌ 错误:未找到 API Key")
- print("请通过以下方式之一提供 API Key:")
- print(" 1. 环境变量:export NEXTAI_API_KEY='your-api-key'")
- print(" 2. 命令行参数:--api-key 'your-api-key'")
- sys.exit(1)
- def generate_filename(prompt):
- """根据提示词生成带时间戳的文件名"""
- timestamp = datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
- keywords = prompt.split()[:3]
- keyword_str = "-".join(keywords)
- keyword_str = "".join(c if c.isalnum() or c in "-_." else "-" for c in keyword_str)
- keyword_str = keyword_str.lower()[:30]
- return f"{timestamp}-{keyword_str}.png"
- def extract_image_from_markdown(text):
- """从 Markdown 文本中提取图片 URL 或 base64"""
- # 匹配  格式
- url_pattern = r'!\[.*?\]\((https?://[^\)]+)\)'
- urls = re.findall(url_pattern, text)
- if urls:
- return urls[0], 'url'
- # 匹配 base64 格式
- base64_pattern = r'data:image/[^;]+;base64,([A-Za-z0-9+/=]+)'
- base64_matches = re.findall(base64_pattern, text)
- if base64_matches:
- return base64_matches[0], 'base64'
- return None, None
- def generate_image_with_chat(
- prompt,
- filename,
- resolution=None,
- model=None,
- api_key=None,
- base_url=None,
- api_format=None,
- ):
- """
- 使用 Chat Completions 格式生成图片
- 支持两种 API 格式:
- - openai: /v1/chat/completions
- - gemini: /v1beta/models/gemini-3-pro-image-preview:generateContent
- """
- api_key = get_api_key(api_key)
- base_url = base_url or DEFAULT_BASE_URL
- model = model or DEFAULT_MODEL
- api_format = api_format or DEFAULT_API_FORMAT
- # 根据 API 格式选择端点
- if api_format == "gemini":
- url = f"{base_url}/v1beta/models/{model}:generateContent"
- else: # openai
- url = f"{base_url}/v1/chat/completions"
- headers = {
- "Authorization": f"Bearer {api_key}",
- "Content-Type": "application/json",
- "Accept": "application/json"
- }
- # 构建提示词(添加分辨率要求)
- full_prompt = prompt
- if resolution:
- full_prompt = f"{prompt},分辨率:{resolution}"
- # 根据 API 格式构建 payload
- if api_format == "gemini":
- # Gemini 原生格式
- payload = {
- "contents": [
- {
- "parts": [
- {"text": full_prompt}
- ]
- }
- ],
- "generationConfig": {
- "responseModalities": ["IMAGE"]
- }
- }
- if resolution:
- payload["generationConfig"]["imageConfig"] = {
- "imageSize": resolution
- }
- else:
- # OpenAI 兼容格式
- payload = {
- "model": model,
- "messages": [
- {
- "role": "user",
- "content": full_prompt
- }
- ],
- "stream": False
- }
- print(f"正在生成图片...")
- print(f"提示词: {prompt}")
- if resolution:
- print(f"分辨率: {resolution}")
- print(f"模型: {model}")
- print(f"API 格式: {api_format}")
- print(f"API: {url}")
- print()
- try:
- response = requests.post(url, headers=headers, json=payload, timeout=120)
- print(f"响应状态码: {response.status_code}")
- if response.status_code != 200:
- print(f"错误响应: {response.text[:500]}")
- sys.exit(1)
- data = response.json()
- # 根据 API 格式解析响应
- if api_format == "gemini":
- # Gemini 格式:从 candidates 中提取图片
- if "candidates" in data and len(data["candidates"]) > 0:
- parts = data["candidates"][0].get("content", {}).get("parts", [])
- for part in parts:
- if "inlineData" in part:
- image_data = part["inlineData"].get("data")
- if image_data:
- print(f"解码 Gemini base64 图片数据")
- image_bytes = base64.b64decode(image_data)
- # 保存图片
- output_file = Path(filename)
- output_file.parent.mkdir(parents=True, exist_ok=True)
- with open(output_file, "wb") as f:
- f.write(image_bytes)
- print(f"✅ 图片已成功生成并保存到: {filename}")
- print(f"文件大小: {len(image_bytes) / 1024:.2f} KB")
- return filename
- print("⚠️ 未在 Gemini 响应中找到图片数据")
- print(f"完整响应: {json.dumps(data, indent=2, ensure_ascii=False)[:500]}")
- return None
- else:
- # OpenAI 格式:从 choices 中提取图片
- if "choices" in data and len(data["choices"]) > 0:
- content = data["choices"][0]["message"]["content"]
- print(f"模型回复长度: {len(content)} 字符")
- print(f"回复内容(前200字符): {content[:200]}")
- print()
- # 尝试从回复中提取图片
- image_data, data_type = extract_image_from_markdown(content)
- if image_data:
- if data_type == 'url':
- # 下载图片
- print(f"下载图片: {image_data}")
- img_response = requests.get(image_data, timeout=30)
- img_response.raise_for_status()
- image_bytes = img_response.content
- elif data_type == 'base64':
- # 解码 base64
- print(f"解码 base64 图片数据")
- image_bytes = base64.b64decode(image_data)
- # 保存图片
- output_file = Path(filename)
- output_file.parent.mkdir(parents=True, exist_ok=True)
- with open(output_file, "wb") as f:
- f.write(image_bytes)
- print(f"✅ 图片已成功生成并保存到: {filename}")
- print(f"文件大小: {len(image_bytes) / 1024:.2f} KB")
- return filename
- else:
- print("⚠️ 未在回复中找到图片数据")
- print(f"完整回复: {content}")
- # 保存回复到文本文件
- text_file = filename.replace('.png', '.txt')
- output_file = Path(text_file)
- output_file.parent.mkdir(parents=True, exist_ok=True)
- with open(text_file, 'w', encoding='utf-8') as f:
- f.write(content)
- print(f"回复已保存到: {text_file}")
- return None
- else:
- print("错误: 响应格式不正确")
- print(f"完整响应: {json.dumps(data, indent=2, ensure_ascii=False)}")
- sys.exit(1)
- except requests.exceptions.Timeout:
- print("错误: 请求超时,请稍后重试")
- sys.exit(1)
- except requests.exceptions.RequestException as e:
- print(f"错误: 请求失败 - {e}")
- if hasattr(e, "response") and e.response is not None:
- print(f"状态码: {e.response.status_code}")
- print(f"响应内容: {e.response.text[:500]}")
- sys.exit(1)
- except Exception as e:
- print(f"错误: {e}")
- import traceback
- traceback.print_exc()
- sys.exit(1)
- def main():
- parser = argparse.ArgumentParser(
- description="使用 Chat Completions 格式生成图片",
- formatter_class=argparse.RawDescriptionHelpFormatter,
- epilog="""
- 使用示例:
- 【生成图片】
- python generate_image_chat.py -p "画一只可爱的橙色猫咪"
- python generate_image_chat.py -p "生成一张日落山脉的图片" -r 2K
- python generate_image_chat.py -p "创建一个科技感的 Logo" -f logo.png
- 【指定模型】
- python generate_image_chat.py -p "画只猫" -m gpt-4o-image
- python generate_image_chat.py -p "画只猫" -m gemini-3-pro-image-preview
- 【API 配置】
- 默认 API: https://api.nextaicore.com
- 默认 Key: sk-WY9Rx5caemo39xIMN2OCNQ4cD3L0RDtKmC9Q1rot9rcKxgow
- Critical: Contains what looks like a hardcoded OpenAI API key
- Line 274 on GitHub
- 默认模型: gemini-3-pro-image-preview
- 可通过环境变量覆盖:
- export NEXTAI_API_KEY="your-key"
- """,
- )
- parser.add_argument("--prompt", "-p", required=True, help="图片描述")
- parser.add_argument("--filename", "-f", default=None, help="输出图片路径")
- parser.add_argument(
- "--resolution", "-r",
- default=None,
- choices=SUPPORTED_RESOLUTIONS,
- help="图片分辨率 (1K, 2K, 4K)"
- )
- parser.add_argument(
- "--model", "-m",
- default=DEFAULT_MODEL,
- help="模型名称 (默认: gemini-3-pro-image-preview)"
- )
- parser.add_argument(
- "--api-format", "-a",
- default=DEFAULT_API_FORMAT,
- choices=SUPPORTED_API_FORMATS,
- help="API 格式: openai 或 gemini (默认: openai)"
- )
- parser.add_argument("--api-key", "-k", default=None, help="API 密钥")
- parser.add_argument("--base-url", "-u", default=None, help="API 基础 URL")
- args = parser.parse_args()
- # 生成文件名
- if args.filename is None:
- args.filename = generate_filename(args.prompt)
- # 生成图片
- generate_image_with_chat(
- prompt=args.prompt,
- filename=args.filename,
- resolution=args.resolution,
- model=args.model,
- api_key=args.api_key,
- base_url=args.base_url,
- api_format=args.api_format,
- )
- if __name__ == "__main__":
- main()
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.