feishu-file飞书文件发送技能。支持发送各类文件到飞书聊天,包括文档、图片、压缩包等,自动识别文件类型并处理上传。
Install via ClawdBot CLI:
clawdbot install franklu0819-lang/feishu-file将本地文件发送到飞书聊天,支持多种文件类型,自动识别并正确处理。
# 飞书配置
export FEISHU_APP_ID="cli_xxx" # 飞书应用 ID
export FEISHU_APP_SECRET="your_secret" # 飞书应用密钥
export FEISHU_RECEIVER="ou_xxx" # 接收者 Open ID(可选,默认从上下文获取)
curl - HTTP 请求jq - JSON 处理file - 文件类型识别# 发送文件
bash scripts/send_file.sh /path/to/file.pdf
# 发送文件到指定接收者
bash scripts/send_file.sh /path/to/file.pdf ou_xxxxx
| 类型 | 扩展名 | file_type | 最大大小 |
|------|--------|-----------|----------|
| PDF | .pdf | pdf | 30 MB |
| Word | .doc, .docx | doc, docx | 30 MB |
| Excel | .xls, .xlsx | xls, xlsx | 30 MB |
| PowerPoint | .ppt, .pptx | ppt, pptx | 30 MB |
| 图片 | .jpg, .jpeg, .png, .gif, .bmp, .webp | image | 20 MB |
| 音频 | .mp3, .wav, .aac, .ogg, .m4a, .amr, .flac, .wma | audio | 30 MB |
| 视频 | .mp4, .mov, .avi, .mkv, .flv, .wmv, .webm, .m4v | video | 50 MB |
| 压缩包 | .zip, .rar, .7z, .tar, .gz | stream | 30 MB |
| 文本 | .txt, .md, .json, .xml, .csv | stream | 30 MB |
| 其他 | 其他文件类型 | stream | 30 MB |
注意: opus 格式是飞书音频消息专用格式,不作为文件附件处理。如需发送语音消息,请使用 feishu-voice 技能。
主脚本,完整的文件发送流程。
用法:
bash scripts/send_file.sh <文件路径> [接收者ID]
参数:
文件路径 (必需): 要发送的文件路径接收者ID (可选): 接收者 Open ID(默认使用环境变量 FEISHU_RECEIVER)环境变量:
FEISHU_APP_ID: 飞书应用 IDFEISHU_APP_SECRET: 飞书应用密钥FEISHU_RECEIVER: 接收者 Open ID(可选)| 文件类型 | 大小限制 |
|---------|---------|
| 图片 | 20 MB |
| 音频 | 30 MB |
| 视频 | 50 MB |
| 其他文件(PDF、Office、压缩包等) | 30 MB |
上传文件时需要指定 file_type 参数:
image: 图片文件audio: 音频文件video: 视频文件pdf: PDF 文件doc, docx: Word 文档xls, xlsx: Excel 文档ppt, pptx: PowerPoint 文档stream: 其他文件(压缩包、文本等)| 端点 | 用途 |
|------|------|
| /auth/v3/tenant_access_token/internal | 获取访问令牌 |
| /im/v1/files | 上传文件 |
| /im/v1/messages | 发送消息 |
发送文件消息的 JSON 格式:
{
"msg_type": "file",
"content": "{\"file_key\": \"file_v2_xxx\"}"
}
问题: 文件上传返回错误
可能原因:
解决:
# 检查文件大小
ls -lh /path/to/file
# 检查文件类型
file /path/to/file
问题: 上传时返回权限错误
解决: 确保飞书应用有以下权限:
im:messageim:message:send_as_botim:file问题: 发送消息时返回接收者不存在
解决: 确认接收者 ID 正确:
ou_xxxoc_xxx# 设置环境变量
export FEISHU_APP_ID="your_app_id_here"
export FEISHU_APP_SECRET="your_app_secret_here"
export FEISHU_RECEIVER="ou_xxxxx"
# 发送 PDF 文件
bash /root/.openclaw/workspace/skills/feishu-file/scripts/send_file.sh \
/path/to/document.pdf
# 发送到指定接收者
bash /root/.openclaw/workspace/skills/feishu-file/scripts/send_file.sh \
/path/to/report.xlsx ou_yyyyy
feishu-voice: 发送语音消息feishu-doc: 飞书文档操作feishu-drive: 飞书云盘操作Generated Mar 1, 2026
Distributed teams use this skill to share project files like reports, presentations, and images directly in Feishu chat. It automates file uploads and notifications, improving communication efficiency without manual steps.
Support agents send troubleshooting guides, invoices, or documentation to customers via Feishu. The skill handles various file types, ensuring quick delivery and reducing response times in customer interactions.
Teachers or trainers distribute learning materials such as PDFs, videos, and audio files to students through Feishu groups. It supports large files and automatic type recognition, facilitating seamless remote education.
Marketing teams share campaign assets like images, videos, and compressed design files with internal stakeholders or agencies. The skill ensures files are uploaded correctly and sent promptly for review.
Law firms or legal departments exchange contracts, agreements, and evidence files securely via Feishu. It handles document formats like PDF and Word, with error handling for reliable transmission.
Offer this skill as part of a subscription-based SaaS platform that integrates with Feishu for businesses. Charge per user or usage tier, providing automated file management and collaboration tools.
Provide consulting and customization services to companies needing tailored file-sharing solutions on Feishu. Revenue comes from setup fees, training, and ongoing support for integration and optimization.
Release a free version with basic file-sending capabilities and a paid version offering advanced features like batch uploads, analytics, and priority support. Monetize through upgrades and enterprise plans.
💬 Integration Tip
Ensure all required environment variables are set and tools like curl are installed before use; test with small files first to verify connectivity and permissions.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
Read and send email via IMAP/SMTP. Check for new/unread messages, fetch content, search mailboxes, mark as read/unread, and send emails with attachments. Works with any IMAP/SMTP server including Gmail, Outlook, 163.com, vip.163.com, 126.com, vip.126.com, 188.com, and vip.188.com.
Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
Automatically logs into email accounts (Gmail, Outlook, QQ Mail, etc.) and generates daily email summaries. Use when the user wants to get a summary of their emails, check important messages, or create daily email digests.
Fetch content from Feishu (Lark) Wiki, Docs, Sheets, and Bitable. Automatically resolves Wiki URLs to real entities and converts content to Markdown.
Manage Feishu (Lark) calendars by listing, searching, checking schedules, syncing events, and marking tasks with automated date extraction.