← 返回 Skills 市场
brucezhu888

Feishu File Upload

作者 brucezhu888 · GitHub ↗ · v1.0.3 · MIT-0
cross-platform ✓ 安全检测通过
131
总下载
1
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install feishu-file-upload
功能描述
Upload and send local files to Feishu chats. Requires Feishu app credentials (app_id/app_secret) in ~/.openclaw/openclaw.json. Use when user asks to send/sha...
使用说明 (SKILL.md)

Feishu File Upload

Upload local files to Feishu Drive and send as file messages to chats or users.

When to Use

  • User asks to "send file", "upload file", or "share file" to Feishu
  • Need to share documents (CSV, PDF, Excel, Word) with group or individual
  • Bot needs to send files that Feishu's native message API doesn't support directly
  • Images/videos: Use media parameter in message tool instead (no need for this skill)

Quick Start

Send to Group Chat

python scripts/upload_to_feishu.py /path/to/file.csv oc_xxxxxx --type chat_id

Send to Individual User

python scripts/upload_to_feishu.py /path/to/file.pdf ou_xxxxxx --type open_id

Send via Email

python scripts/upload_to_feishu.py /path/to/file.zip [email protected] --type email

Use Environment Variable

export OPENCLAW_CHAT_ID=oc_xxxxxx
python scripts/upload_to_feishu.py /path/to/file.csv --env

How It Works

  1. Read credentials from ~/.openclaw/openclaw.json (channels.feishu.appId/appSecret)
  2. Get tenant access token from Feishu Auth API
  3. Upload file to Feishu Drive → returns file_key
  4. Send file message using file_key to target chat/user

Script Usage

Arguments

Argument Required Default Description
file_path Yes - Absolute path to local file
receive_id Yes* - Recipient ID (chat_id, open_id, user_id, or email)
--type No chat_id Recipient type: chat_id, open_id, user_id, email
--env No false Get receive_id from OPENCLAW_CHAT_ID env var

*Not required if --env is used

Receive ID Types

Type Example Use Case
chat_id oc_06a6b40e03e98e41c8aebcbed8b09871 Group chats (default)
open_id ou_b0f83ea276761ab10ebb3f4f277453b8 Individual user (recommended)
user_id 123456 Individual user (by user_id)
email [email protected] Send to email address

Extract Chat ID from Feishu Message

From Feishu message metadata:

{
  "conversation_label": "oc_06a6b40e03e98e41c8aebcbed8b09871"
}

receive_id = oc_06a6b40e03e98e41c8aebcbed8b09871, type = chat_id

From sender info:

{
  "sender_id": "ou_b0f83ea276761ab10ebb3f4f277453b8"
}

receive_id = ou_b0f83ea276761ab10ebb3f4f277453b8, type = open_id

Prerequisites

  • Python 3.6+
  • requests library: pip install requests
  • Feishu bot credentials in openclaw.json

Feishu API Permissions

Bot needs these permissions in Feishu Developer Console:

Required for file upload:

  • im:resource:upload - Upload files (preferred)
  • OR im:resource - Read and upload files

Required for sending messages:

  • im:message - Send messages to chats

How to Enable Permissions

  1. Open Feishu Developer Console: https://open.feishu.cn/app/YOUR_APP_ID/auth
  2. Search for im:resource:upload or im:resource
  3. Click "Apply" and enable the permission
  4. Wait a few minutes for permission to take effect

Quick link: https://open.feishu.cn/app/cli_a94a21db99385bd8/auth?q=im:resource:upload,im:resource

File Size Limits

  • Single file: 30MB max (Feishu API limit)
  • Large files may take longer to upload

Supported File Types

All file types supported by Feishu Drive:

Category Extensions
Documents PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX
Images JPG, PNG, GIF, WEBP
Archives ZIP, RAR, 7Z
Code/Text TXT, MD, JSON, CSV, XML, PY, JS
Media MP3, MP4, WAV (auto-converted to OPUS)

Error Handling

Script handles:

  • Missing credentials → Error message
  • File not found → Error message
  • Upload failure → API error details
  • Send failure → API error details
  • Missing permissions → Clear error with fix link

Testing

# Test with a small file to a group chat
python scripts/upload_to_feishu.py /tmp/test.txt oc_xxxxxx --type chat_id

# Test sending to yourself (find your open_id from message metadata)
python scripts/upload_to_feishu.py /tmp/test.pdf ou_xxxxxx --type open_id

Troubleshooting

"Access denied" / "99991672"

"Bot/User can NOT be out of the chat (230002)"

  • Bot is not a member of the target group chat
  • Add bot to the chat, or send to a different chat

"Invalid receive_id"

  • Check the ID format matches the type
  • chat_id starts with oc_
  • open_id starts with ou_
  • user_id is numeric
  • email must be valid email format

Upload fails for large files

  • Feishu API limit is 30MB
  • Compress file or use Feishu Drive web interface for larger files

Alternative: Manual Upload

If script fails, user can manually:

  1. Upload file to Feishu Drive via web/app
  2. Share file with the chat
  3. Bot can then reference the file

Security Notes

  • Credentials read from openclaw.json (local only)
  • Token expires after ~2 hours (auto-refreshed each run)
  • Files uploaded to Feishu Drive follow Feishu's security policies
  • Script does not store or transmit credentials

Comparison with Message Tool

Feature This Skill Message Tool media
Documents (PDF, CSV, etc.) ✅ Supported ❌ Not supported
Images ✅ Supported ✅ Supported (easier)
Videos ✅ Supported ✅ Supported (easier)
File size limit 30MB Varies by platform
Complexity 2 API calls 1 API call

Recommendation: Use media parameter for images/videos, use this skill for documents and other files.

安全使用建议
This skill appears to do exactly what it says: it reads Feishu app_id/app_secret from ~/.openclaw/openclaw.json, exchanges them for a tenant token, uploads a specified local file, and sends it to the target. Before installing/using: (1) verify the openclaw.json file contains only the Feishu app credentials you intend to use and is stored with appropriate filesystem permissions; (2) ensure the Feishu app has the listed permissions (im:resource:upload or im:resource and im:message); (3) install python3 and the 'requests' package as documented; (4) avoid sending sensitive files unless you trust the Feishu tenant/app and understand Feishu Drive sharing policies; (5) review the included scripts/upload_to_feishu.py yourself if you want to confirm there are no additional behaviors. Overall this is internally coherent and low-risk for its stated purpose.
功能分析
Type: OpenClaw Skill Name: feishu-file-upload Version: 1.0.3 The skill is a legitimate tool for uploading local files to Feishu and sending them as messages. The Python script (scripts/upload_to_feishu.py) reads credentials from a local configuration file (~/.openclaw/openclaw.json) and interacts exclusively with official Feishu API endpoints (open.feishu.cn) to perform its stated functions. No evidence of data exfiltration to unauthorized third parties, malicious execution, or persistence was found.
能力评估
Purpose & Capability
Name/description match the actual behavior: the script uploads a local file to Feishu Drive and sends a file message. Required items (python3, ~/.openclaw/openclaw.json, optional OPENCLAW_CHAT_ID) are appropriate for this functionality.
Instruction Scope
SKILL.md and the script limit actions to reading the indicated openclaw.json credentials, reading the specified local file, calling Feishu APIs to get a token/upload and sending the file. Instructions do not request unrelated files, system state, or unexpected endpoints.
Install Mechanism
No install spec (instruction-only) and the skill includes a Python script. The README notes dependency on the 'requests' library but there is no automated installer; user must ensure python3 and requests are available. This is low risk but worth noting because code will execute when invoked.
Credentials
The only secrets required are Feishu app_id/app_secret stored in ~/.openclaw/openclaw.json and an optional OPENCLAW_CHAT_ID env var. These are proportional to a Feishu upload/send tool and are used as expected.
Persistence & Privilege
Skill does not request permanent presence (always=false), does not modify other skills or system config, and does not persist credentials. It runs only when invoked.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install feishu-file-upload
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /feishu-file-upload 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
- No changes detected in this version. - Version number updated in metadata only. - Functionality and documentation remain the same as previous release.
v1.0.2
- Removed unused metadata file (_meta.json) from the skill package. - No changes to functionality or user experience. - Skill usage, configuration, and documentation remain the same.
v1.0.1
- Added metadata file `_meta.json` for improved skill management and discovery. - No changes to core functionality or user-facing documentation.
v1.0.0
feishu-file-upload 1.0.0 - Initial release of the skill for uploading and sending files to Feishu chats and users. - Supports sending local CSV, PDF, Excel, images, ZIP, and other files to groups (chat_id), users (open_id/user_id), and email addresses. - Command line script with flexible targeting via recipient type or environment variable. - Handles file upload, permissions, and error scenarios for smooth integration with Feishu Drive. - Detailed usage documentation and troubleshooting included.
元数据
Slug feishu-file-upload
版本 1.0.3
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 4
常见问题

Feishu File Upload 是什么?

Upload and send local files to Feishu chats. Requires Feishu app credentials (app_id/app_secret) in ~/.openclaw/openclaw.json. Use when user asks to send/sha... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 131 次。

如何安装 Feishu File Upload?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install feishu-file-upload」即可一键安装,无需额外配置。

Feishu File Upload 是免费的吗?

是的,Feishu File Upload 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Feishu File Upload 支持哪些平台?

Feishu File Upload 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Feishu File Upload?

由 brucezhu888(@brucezhu888)开发并维护,当前版本 v1.0.3。

💬 留言讨论