# Send Feishu Upload Skill to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "feishu-upload-skill",
    "name": "Feishu Upload Skill",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/DeeWooo/feishu-upload-skill",
    "canonicalUrl": "https://clawhub.ai/DeeWooo/feishu-upload-skill",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/feishu-upload-skill",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=feishu-upload-skill",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "_meta.json",
      "example.js",
      "feishu_complete_upload.js",
      "feishu_upload_fixed.sh"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "feishu-upload-skill",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-03T05:33:26.466Z",
      "expiresAt": "2026-05-10T05:33:26.466Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=feishu-upload-skill",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=feishu-upload-skill",
        "contentDisposition": "attachment; filename=\"feishu-upload-skill-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "feishu-upload-skill"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/feishu-upload-skill"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/feishu-upload-skill",
    "downloadUrl": "https://openagent3.xyz/downloads/feishu-upload-skill",
    "agentUrl": "https://openagent3.xyz/skills/feishu-upload-skill/agent",
    "manifestUrl": "https://openagent3.xyz/skills/feishu-upload-skill/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/feishu-upload-skill/agent.md"
  }
}
```
## Documentation

### Feishu Upload Skill

飞书文件上传技能 - 直接上传文件到飞书并发送到聊天

### 功能特性

✅ 文件上传：上传本地文件到飞书云盘
✅ 消息发送：发送文件消息到指定聊天
✅ 自动令牌管理：自动获取和刷新访问令牌
✅ 大小限制检查：自动检查30MB文件大小限制
✅ 多格式支持：支持各种文件类型（文本、图片、压缩包等）
✅ 纯Node.js实现：无需额外依赖，使用Node.js 18+原生功能

### 1. 上传文件并发送到聊天

node feishu_complete_upload.js <文件路径> <聊天ID>

示例：

node feishu_complete_upload.js document.txt oc_dd899cb1a7846915cdd2d6850bd1dafa

### 2. 仅上传文件（获取文件Key）

node feishu_complete_upload.js <文件路径>

### 3. 使用简化脚本

# 简单上传
node native_feishu_upload.js <文件路径>

# 获取访问令牌
./get_feishu_token.sh

### 核心文件

feishu_complete_upload.js - 完整的上传和发送工具（推荐）
native_feishu_upload.js - 使用原生FormData的简单上传工具
get_feishu_token.sh - 获取和刷新访问令牌的脚本

### 辅助文件

feishu_upload_simple.sh - Bash实现的简单上传脚本
feishu_upload_fixed.sh - 修复版Bash上传脚本
simple_feishu_upload.js - 简化版Node.js上传工具

### 配置文件

feishu_token.txt - 访问令牌缓存文件（自动生成）
upload_result.json - 上次上传的结果文件

### 三步上传流程

获取访问令牌：使用App ID和Secret获取tenant_access_token
上传文件：使用飞书/im/v1/files API上传文件，获取file_key
发送消息：使用file_key发送文件消息到指定聊天

### API端点

获取令牌：POST /open-apis/auth/v3/tenant_access_token/internal
上传文件：POST /open-apis/im/v1/files
发送消息：POST /open-apis/im/v1/messages

### 权限要求

im:message:send_as_bot - 发送消息权限
im:file:send_as_bot - 发送文件权限（可能需要）
文件上传权限（通过drive:file:upload已授权）

### 示例1：上传文本文件

# 创建测试文件
echo "测试内容" > test.txt

# 上传并发送到群聊
node feishu_complete_upload.js test.txt oc_dd899cb1a7846915cdd2d6850bd1dafa

### 示例2：上传图片文件

# 上传图片
node feishu_complete_upload.js photo.jpg oc_dd899cb1a7846915cdd2d6850bd1dafa

### 示例3：上传压缩包

# 压缩文件
tar -czf archive.tar.gz folder/

# 上传压缩包
node feishu_complete_upload.js archive.tar.gz oc_dd899cb1a7846915cdd2d6850bd1dafa

### 常见错误

令牌过期：自动刷新令牌
文件太大：超过30MB限制
权限不足：检查飞书应用权限配置
网络问题：自动重试机制

### 调试模式

# 查看详细日志
DEBUG=1 node feishu_complete_upload.js file.txt chat_id

### 作为工具调用

const { execSync } = require('child_process');
const result = execSync('node feishu_complete_upload.js file.txt chat_id').toString();
console.log(JSON.parse(result));

### 作为Skill使用

将此文件夹复制到skills/目录
在OpenClaw配置中启用
通过命令或API调用

### 注意事项

文件大小：最大支持30MB文件
令牌有效期：访问令牌2小时有效，自动刷新
权限配置：确保飞书应用有正确的权限
网络环境：需要能访问飞书API的网络环境
Node.js版本：需要Node.js 18+（支持全局FormData和fetch）

### v1.0.0 (2026-02-12)

✅ 初始版本发布
✅ 完整的文件上传和发送功能
✅ 自动令牌管理
✅ 错误处理和日志
✅ 多文件格式支持

### 许可证

MIT License - 自由使用和修改
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: DeeWooo
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-03T05:33:26.466Z
- Expires at: 2026-05-10T05:33:26.466Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/feishu-upload-skill)
- [Send to Agent page](https://openagent3.xyz/skills/feishu-upload-skill/agent)
- [JSON manifest](https://openagent3.xyz/skills/feishu-upload-skill/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/feishu-upload-skill/agent.md)
- [Download page](https://openagent3.xyz/downloads/feishu-upload-skill)