
feishu-automation
飞书(Lark)全通道自动化。使用 lark-mcp 工具操作飞书多维表格(Bitable)、发送消息、管理文档、创建群组、自动化工作流等。当用户需要操作飞书平台、同步数据到飞书表格、发送飞书通知、管理飞书文档或自动化飞书业务流程时使用此技能。
- Installs
- 393
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/aaaaqwq/agi-super-team --skill feishu-automation- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads feishu-automation automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
飞书全通道自动化
使用 lark-mcp 工具实现飞书平台的全面自动化操作。
核心功能
1. 多维表格(Bitable)
- 创建多维表格和数据表
- 添加、修改、删除字段
- 增删改查记录数据
- 批量导入导出数据
- 数据筛选和排序
2. 消息发送
- 发送文本、富文本、卡片消息
- 群组消息和私聊消息
- 消息模板和交互式卡片
- 文件和图片发送
3. 文档管理
- 搜索云文档
- 创建新文档
- 编辑文档内容
- 文档权限管理
- 文档协作者管理
4. 群组管理
- 创建群组
- 添加/移除成员
- 获取群组列表
- 群组信息查询
5. 知识库(Wiki)
- 搜索知识库节点
- 获取节点详情
- 创建和管理知识库内容
6. 日历和任务
- 创建和查询日历事件
- 创建和管理任务
- 任务分配和跟踪
快速开始
检查 MCP 可用性
// 检查 lark-mcp 工具是否可用
// 可用工具前缀:mcp__lark-mcp_
发送测试消息
// 发送文本消息到群组
await mcp__lark-mcp_sendMessage({
receive_id: "oc_xxxxxxxxx",
msg_type: "text",
content: JSON.stringify({
text: "Hello from Clawdbot!"
})
});
工作流程
数据同步流程
- 连接数据源
- 转换数据格式
- 创建/更新多维表格
- 批量写入数据
- 发送通知
消息推送流程
- 触发事件(定时/事件驱动)
- 构建消息内容
- 获取接收者 ID
- 发送消息
- 记录日志
文档自动化流程
- 获取文档模板
- 填充内容
- 创建新文档
- 设置权限
- 分享给团队
API 工具参考
多维表格相关
createBitable- 创建多维表格createTable- 创建数据表addRecord- 添加记录updateRecord- 更新记录deleteRecord- 删除记录searchRecords- 搜索记录getRecord- 获取记录详情
消息相关
sendMessage- 发送消息getMessages- 获取消息历史replyMessage- 回复消息
文档相关
searchDocs- 搜索文档createDoc- 创建文档getDoc- 获取文档内容updateDoc- 更新文档setDocPermission- 设置文档权限
📄 Markdown 导入云文档(推荐方式)
最佳实践:将本地 Markdown 文件直接导入为飞书云文档,格式完整保留。
# 1. 获取 access_token
TOKEN=$(curl -s -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
-H 'Content-Type: application/json' \
-d '{"app_id":"YOUR_APP_ID","app_secret":"YOUR_APP_SECRET"}' \
| python3 -c "import sys,json; print(json.load(sys.stdin).get('tenant_access_token',''))")
# 2. 上传 md 文件到飞书云盘
FILE_TOKEN=$(curl -s -X POST 'https://open.feishu.cn/open-apis/drive/v1/files/upload_all' \
-H "Authorization: Bearer $TOKEN" \
-F "file_name=document.md" \
-F "parent_type=explorer" \
-F "parent_node=" \
-F "size=$(stat -c%s /path/to/document.md)" \
-F "file=@/path/to/document.md" \
| python3 -c "import sys,json; print(json.load(sys.stdin).get('data',{}).get('file_token',''))")
# 3. 导入为飞书云文档
TICKET=$(curl -s -X POST 'https://open.feishu.cn/open-apis/drive/v1/import_tasks' \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"file_extension": "md",
"file_token": "'"$FILE_TOKEN"'",
"type": "docx",
"point": {"mount_type": 1, "mount_key": ""}
}' | python3 -c "import sys,json; print(json.load(sys.stdin).get('data',{}).get('ticket',''))")
# 4. 等待导入完成,获取文档链接
sleep 2
curl -s -X GET "https://open.feishu.cn/open-apis/drive/v1/import_tasks/$TICKET" \
-H "Authorization: Bearer $TOKEN" \
| python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('data',{}).get('result',{}).get('url',''))"
支持的导入格式:
md→ Markdowndocx→ Word 文档xlsx→ Excel 表格
注意事项:
- 导入是异步操作,需要轮询
import_tasks/{ticket}获取结果 mount_type: 1表示导入到"我的空间"- 导入后的文档 URL 格式:
https://xxx.feishu.cn/docx/{token}
📤 完整输出云文档流程(标准操作)
每次输出云文档时,必须完成以下步骤:
- 生成本地 Markdown 文件
- 上传到飞书云盘 →
drive/v1/files/upload_all - 导入为云文档 →
drive/v1/import_tasks - 设置权限为组织内可编辑 →
drive/v1/permissions/{token}/public - 发送链接到目标群
# 完整流程脚本
TOKEN=$(curl -s -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
-H 'Content-Type: application/json' \
-d '{"app_id":"APP_ID","app_secret":"APP_SECRET"}' \
| python3 -c "import sys,json; print(json.load(sys.stdin).get('tenant_access_token',''))")
# 1. 上传文件
FILE_TOKEN=$(curl -s -X POST 'https://open.feishu.cn/open-apis/drive/v1/files/upload_all' \
-H "Authorization: Bearer $TOKEN" \
-F "file_name=document.md" \
-F "parent_type=explorer" \
-F "parent_node=" \
-F "size=$(stat -c%s document.md)" \
-F "file=@document.md" \
| python3 -c "import sys,json; print(json.load(sys.stdin).get('data',{}).get('file_token',''))")
# 2. 导入为云文档
TICKET=$(curl -s -X POST 'https://open.feishu.cn/open-apis/drive/v1/import_tasks' \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"file_extension":"md","file_token":"'"$FILE_TOKEN"'","type":"docx","point":{"mount_type":1,"mount_key":""}}' \
| python3 -c "import sys,json; print(json.load(sys.stdin).get('data',{}).get('ticket',''))")
sleep 2
# 3. 获取文档 token
DOC_RESULT=$(curl -s -X GET "https://open.feishu.cn/open-apis/drive/v1/import_tasks/$TICKET" \
-H "Authorization: Bearer $TOKEN")
DOC_TOKEN=$(echo "$DOC_RESULT" | python3 -c "import sys,json; print(json.load(sys.stdin).get('data',{}).get('result',{}).get('token',''))")
DOC_URL=$(echo "$DOC_RESULT" | python3 -c "import sys,json; print(json.load(sys.stdin).get('data',{}).get('result',{}).get('url',''))")
# 4. 设置权限:组织内可编辑
curl -s -X PATCH "https://open.feishu.cn/open-apis/drive/v1/permissions/$DOC_TOKEN/public?type=docx" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"external_access_entity":"open","security_entity":"anyone_can_view","comment_entity":"anyone_can_view","share_entity":"anyone","link_share_entity":"tenant_editable"}'
# 5. 发送到群
curl -s -X POST "https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=chat_id" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"receive_id":"CHAT_ID","msg_type":"text","content":"{\"text\":\"📄 文档已上传:\\n\\n'"$DOC_URL"'\"}"}'
权限设置说明:
link_share_entity: "tenant_editable"→ 组织内获得链接的人可编辑comment_entity: "anyone_can_view"→ 任何人可评论share_entity: "anyone"→ 任何人可分享
群组相关
createGroup- 创建群组addMember- 添加成员getGroupList- 获取群组列表getGroupInfo- 获取群组信息
实用场景
1. 自动化日报收集
- 每日定时创建表格记录
- 成员填写日报
- 自动汇总统计
- 发送到群组
2. 审批流程
- 创建审批表格
- 监听状态变更
- 自动通知审批人
- 记录审批历史
3. 任务管理
- 创建任务表格
- 分配任务给成员
- 发送任务提醒
- 跟踪完成状态
4. 客户管理
- 客户信息表格
- 跟进记录
- 自动提醒
- 数据可视化
5. 报表生成
- 从表格提取数据
- 生成统计报表
- 创建飞书文档
- 定期推送更新
最佳实践
认证配置
- 使用提供的 App ID 和 App Secret
- 遵守 API 调用频率限制
- 缓存 access_token
数据操作
- 批量操作使用分页
- 数据写入前验证格式
- 错误处理和重试
- 记录操作日志
消息发送
- 使用交互式卡片提升体验
- 合理控制发送频率
- 避免发送敏感信息
- 支持用户交互
权限管理
- 最小权限原则
- 定期审查权限
- 协作者生命周期管理
错误处理
常见错误
- 权限不足 - 检查应用权限配置
- 限流错误 - 实现重试和等待
- 无效 ID - 验证用户/群组 ID 格式
- 网络错误 - 实现重试机制
重试策略
- 指数退避算法
- 最大重试次数限制
- 记录失败请求
- 通知管理员
安全注意事项
- 保护 App Secret
- 不要在日志中记录敏感信息
- 使用环境变量管理凭证
- 定期轮换访问令牌
- 遵守数据隐私法规
示例代码
创建多维表格并添加数据
// 创建多维表格
const bitable = await mcp__lark-mcp_createBitable({
name: "项目管理",
folder_token: "folder_token"
});
// 创建数据表
const table = await mcp__lark-mcp_createTable({
app_token: bitable.app_token,
table: {
name: "任务列表",
fields: [
{ field_name: "任务名称", type: 1 },
{ field_name: "负责人", type: 13 },
{ field_name: "状态", type: 3 },
{ field_name: "截止日期", type: 5 }
]
}
});
// 添加记录
await mcp__lark-mcp_addRecord({
app_token: bitable.app_token,
table_id: table.table_id,
fields: {
"任务名称": "完成项目文档",
"负责人": "user_id",
"状态": "进行中",
"截止日期": Date.now()
}
});
发送卡片消息
await mcp__lark-mcp_sendMessage({
receive_id: "chat_id",
msg_type: "interactive",
content: JSON.stringify({
config: {
wide_screen_mode: true
},
header: {
template: "turquoise",
title: {
content: "重要通知",
tag: "plain_text"
}
},
elements: [
{
tag: "div",
text: {
content: "**项目里程碑已完成**",
tag: "lark_md"
}
},
{
tag: "action",
actions: [
{
tag: "button",
text: {
content: "查看详情",
tag: "plain_text"
},
type: "primary",
url: "https://example.com"
}
]
}
]
})
});
批量导入数据
const data = [
{ name: "张三", phone: "13800138000" },
{ name: "李四", phone: "13900139000" }
];
for (const item of data) {
await mcp__lark-mcp_addRecord({
app_token: "app_token",
table_id: "table_id",
fields: {
"姓名": item.name,
"电话": item.phone
}
});
// 避免限流
await new Promise(resolve => setTimeout(resolve, 100));
}
配置验证
检查 MCP 服务器
# 检查 .claude.json 中的 lark-mcp 配置
cat ~/.claude.json | grep -A 15 "lark-mcp"
测试连接
// 发送测试消息验证连接
await mcp__lark-mcp_sendMessage({
receive_id: "your_chat_id",
msg_type: "text",
content: JSON.stringify({
text: "🎉 飞书 MCP 连接成功!"
})
});
进阶用法
Webhook 集成
- 监听飞书 Webhook 事件
- 自动触发工作流
- 实时数据同步
自动化定时任务
- 定时发送报告
- 自动数据备份
- 定期清理
跨平台集成
- 与 GitHub 集成(Issue 同步)
- 与邮件集成(通知推送)
- 与日历集成(日程管理)
故障排查
MCP 工具不可用
- 重启 Claude Desktop
- 检查网络连接
- 验证凭证是否有效
- 查看错误日志
API 调用失败
- 检查应用权限配置
- 验证用户/群组 ID
- 查看限流状态
- 检查数据格式
权限不足
- 登录飞书开放平台
- 检查应用权限范围
- 重新授权
- 等待权限生效
FAQ
What does the feishu-automation skill do?
飞书(Lark)全通道自动化。使用 lark-mcp 工具操作飞书多维表格(Bitable)、发送消息、管理文档、创建群组、自动化工作流等。当用户需要操作飞书平台、同步数据到飞书表格、发送飞书通知、管理飞书文档或自动化飞书业务流程时使用此技能。
How do I install feishu-automation?
Run npx skills add https://github.com/aaaaqwq/agi-super-team --skill feishu-automation in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/feishu-automation/ (personal) or .claude/skills/feishu-automation/ (project).
Which AI agents can use feishu-automation?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is feishu-automation safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains feishu-automation?
It is published by aaaaqwq in aaaaqwq/agi-super-team. It has 393 recorded installs.
More from aaaaqwq/agi-super-team
multi-search-engine
aaaaqwq/agi-super-team
Multi search engine integration with 17 engines (8 CN + 9 Global). Supports advanced search operators, time filters, site search, privacy engines, and WolframAlpha knowledge queries. No API keys required.
web-scraping-automation
aaaaqwq/agi-super-team
自动化爬取网站数据和 API 接口。当用户需要抓取网页内容、调用 API、解析数据或创建爬虫脚本时使用此技能。
wechat-channel
aaaaqwq/agi-super-team
微信 (WeChat) 与 OpenClaw 的双向集成通道。基于 Wechaty + PadLocal 实现微信消息的接收和发送,支持私聊、群聊、@提及检测、图片/文件传输。当需要通过微信与 AI 助手交互、接收微信消息触发 AI 响应、或从 OpenClaw 发送消息到微信时使用此技能。
project-management
aaaaqwq/agi-super-team
Open the skill to read its SKILL.md instructions.
wecom-automation
aaaaqwq/agi-super-team
企业微信个人账号直连自动化。基于 Wechaty 框架实现企业微信消息接收、自动同意好友、知识库问答、人工介入提醒。适用于企业微信个人机器人和自动化助手场景。
memory-hygiene
aaaaqwq/agi-super-team
Audit, clean, and optimize Clawdbot's vector memory (LanceDB). Use when memory is bloated with junk, token usage is high from irrelevant auto-recalls, or setting up memory maintenance automation.
Popular productivity & automation skills
agent-browser
vercel-labs/agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
lark-doc
open.feishu.cn
飞书云文档(Docx / Wiki)内容操作:读取、创建、编辑文档,插入或下载图片附件,以及操作思维笔记。用户提供文档 URL/token(包括 doubao.com 的 /docx/、/wiki/)时使用;按 URL 路径/token 而非域名路由;/page/ 是妙搭应用,非飞书云文档。文档内嵌资源按读取参考中的统一规则分流。独立评论操作走 lark-drive;随正文读取评论使用 docs +fetch。表格或 Base 内部数据操作不在本 skill。
lark-base
open.feishu.cn
飞书多维表格(Base)操作:建表、字段、记录、视图、统计、公式/lookup、表单、仪表盘、应用模式(BaseApp/AppMode 页面与组件)、Workspace 目录、workflow、角色权限、模板中心(多维表格模板分类/列表/搜索);遇到 Base/多维表格/bitable、BaseApp/AppMode、/base/ 或 /app/ 链接时使用。BaseApp 不走 lark-apps;文件导入/导出转 lark-drive,认证/授权转 lark-shared。
lark-drive
open.feishu.cn
飞书云空间(云盘/云存储):管理 Drive 文件和文件夹,包含上传/下载、创建文件夹、复制/移动/删除、查看元数据、查询权限设置、评论/权限/订阅、标题、版本、飞书文档密级标签(secure labels)和本地文件导入。用户需要整理云盘目录、处理云空间资源 URL/token、判断链接类型/真实 token/标题,或导入 Word/Markdown/Excel/CSV/PPTX/.base 为 docx/sheet/bitable/slides 时使用;doubao.com 云空间 URL/token 也按资源路径和 token 路由,不回退 WebFetch。不负责:文档内容编辑(走 lark-doc)、表格/Base 表内数据操作(走 lark-sheets/lark-base)、知识空间节点/成员管理(走 lark-wiki)、原生 Markdown 文件读写/patch/diff(走 lark-markdown)。
lark-shared
open.feishu.cn
Use for lark-cli setup/auth tasks: auth login/status/logout, user vs bot identity, business-domain permissions (--domain, including all/docs/drive), missing scopes, revoking authorization, or handling notice JSON.
lark-im
open.feishu.cn
飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)、监听卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索群、创建群聊或话题群、管理标记数据、管理 Feed 置顶(添加/移除/查询置顶会话)、管理标签数据、处理卡片回调时使用。