Install
openclaw skills install feishu-notesRead, write, and manage Feishu (飞书) documents via the Open API. Supports creating documents, reading content, appending text, and auto-refreshing OAuth tokens. Documents are created in the user's personal cloud drive under a designated folder.
openclaw skills install feishu-notes飞书文档读写工具。支持在用户的个人云盘内创建、读取、写入文档,自动管理 OAuth 续期。
跟着这 7 步走,小白也能配置好。
My Notes,点确定左侧菜单 → 权限管理 → 搜索并添加 2 个权限:
| 权限名称 | 搜索关键词 |
|---|---|
drive:drive(云盘完全读写) | 搜索 drive |
docx:document(文档读写) | 搜索 docx |
勾选后点 批量开通。
左侧菜单 → 安全设置 → 重定向 URL → 添加:
https://open.feishu.cn/cli/callback
打开终端,执行以下命令(换成你自己的 App ID 和 Secret):
echo 'FEISHU_APP_ID=cli_xxxxxxxxxxxxxxxxxxxx' >> ~/.openclaw/.feishu_env
echo 'FEISHU_APP_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxx' >> ~/.openclaw/.feishu_env
chmod 600 ~/.openclaw/.feishu_env
如果你想把笔记归纳到指定文件夹:
Ace笔记)xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)scripts/feishu_docs.py,找到 ACE_FOLDER_TOKEN 换成你的文件夹 ID不改也没关系,文档会默认创建在云盘根目录。
1.0.0)→ 提交审核先加载凭证,然后运行授权命令:
source ~/.openclaw/.feishu_env
cd ~/.openclaw/workspace
python3 scripts/feishu_docs.py token
终端会输出一个链接 → 浏览器打开它 → 扫码登录飞书 → 授权后会跳转 → 地址栏 ?code=xxx 那串复制下来 → 粘贴到终端回车。
看到 Token 刷新成功! 就搞定了。
source ~/.openclaw/.feishu_env
cd ~/.openclaw/workspace
python3 scripts/feishu_docs.py create "Hello World"
返回一个飞书链接,点开能看到文档 → 配置成功 🎉
python3 scripts/feishu_docs.py list # 列出云盘最近文档
python3 scripts/feishu_docs.py read <doc_id> # 读取文档内容
python3 scripts/feishu_docs.py create <title> # 创建文档
python3 scripts/feishu_docs.py write <doc_id> <text> # 追加文本段落
python3 scripts/feishu_docs.py bold <doc_id> <text> # 追加加粗文本
python3 scripts/feishu_docs.py heading <doc_id> <text> [level=2] # 追加标题(level=2为H2,3为H3)
python3 scripts/feishu_docs.py token # 查看/刷新 token 状态
python3 scripts/feishu_docs.py code <doc_id> <text> # 追加代码块(纯文本,不带 style 字段)
python3 scripts/feishu_docs.py image <doc_id> <url> # 从网址插入图片
安装此 Skill 后,你的 Agent 可以理解这些指令:
"记到飞书:今天的会议纪要写了xxx"
"把上周的分析报告追加到笔记里"
"帮我创建一篇周报笔记"
"读取笔记内容给我看看"
"把这张截图插进文档"
Agent 会自动完成创建文档、格式化内容、插入图片等操作。
使用前需要完成一次性的飞书开放平台配置:
drive:drive — 云盘完全读写docx:document — 文档读写https://open.feishu.cn/cli/callback将 App ID 和 App Secret 存入环境变量或配置文件:
# 方式一:环境变量
export FEISHU_APP_ID="your_app_id"
export FEISHU_APP_SECRET="your_app_secret"
# 方式二:配置文件(推荐,chmod 600)
echo 'FEISHU_APP_ID=your_app_id' >> ~/.openclaw/.feishu_env
echo 'FEISHU_APP_SECRET=your_app_secret' >> ~/.openclaw/.feishu_env
chmod 600 ~/.openclaw/.feishu_env
用户需通过 OAuth 授权获取 user_access_token,使文档创建在个人云盘:
code 参数access_token + refresh_tokenFEISHU_FOLDER_TOKEN 环境变量配置)| 端点 | 用途 |
|---|---|
POST /auth/v3/tenant_access_token/internal | 获取应用 Token |
POST /authen/v1/access_token | OAuth 换取用户 Token |
POST /authen/v1/refresh_access_token | 刷新用户 Token |
POST /docx/v1/documents | 创建文档 |
GET /docx/v1/documents/:id/blocks/:id | 读取文档标题 |
GET /docx/v1/documents/:id/blocks/:id/children | 读取文档内容(分页) |
POST /docx/v1/documents/:id/blocks/:id/children | 追加内容块 |
DELETE /drive/v1/files/:id?type=docx | 删除文档 |
POST /drive/v1/files/:id/move | 移动文档到文件夹 |
H1 = 日期(当天笔记标题)
H2 = 数字序号 + 独立内容标题
H3 = 内容内短标题
CLI 命令/代码 → 飞书代码块(block_type=14),注意不要加 style 字段,API 会拒绝
步骤流程 → 编号列表(1. 2. 3.)
Emoji 仅用于以下场景:
| Emoji | 场景 |
|---|---|
| ⚠️ | 注意事项、警告 |
| 💡 | 重点提示、诀窍 |
| ✅ | 完成状态 |
| 🔒 | 安全相关 |
| 🚀 / ✨ | 标题或里程碑 |
加粗:关键术语、重要结论、核心数字 — 使用 text_element_style.bold: true
🔴 颜色标签:H3 标题前可用颜色 emoji 区分模块,正文中红色/橙色用于警示性重点
行内代码:文件名、命令、参数、API 端点 — 使用 text_element_style.inline_code: true
飞书 Docx API 不支持一步创建带图的图片块,需分三步:
注意事项: