360 Secure SkillHub
360 安全技能中心

Feishu File Sender

核心功能是通过Shell脚本将本地任意类型文件发送至飞书用户或群组,支持open_id、chat_id等多种接收者类型。典型场景包括推送工作文档、共享归档文件等。输入为本地文件路径,可指定接收者ID及类型;输出为飞书聊天内的文件消息。需配置飞书应用凭证,依赖curl、jq工具。

franklu0819-lang
franklu0819-lang
热度 81.64
最近更新 2026-05-17 12:48:36
分类:自动化依赖:代码执行 / 读写文件 / 第三方 API应用场景:工作流 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add feishu-file
Metadata
name
feishu-file
description
Send local files to Feishu chats. Supports uploading and sending any file type as a Feishu file message.
metadata
{"openclaw":{"requires":{"bins":["curl","jq"],"env":["FEISHU_APP_ID","FEISHU_APP_SECRET"]}}}

Feishu File Sender

A skill to send local files to Feishu users or groups.

Setup

Requires Feishu App credentials. Ensure these are set in your environment or openclaw.json:

export FEISHU_APP_ID="cli_xxx"
export FEISHU_APP_SECRET="xxx"
export FEISHU_RECEIVER="ou_xxx" # Default receiver (optional)

Usage

Basic Usage

Send a file to the default receiver (configured in FEISHU_RECEIVER):

bash scripts/send_file.sh "/path/to/your/file.pdf"

Specific Receiver

Send to a specific OpenID:

bash scripts/send_file.sh "/path/to/report.xlsx" "ou_abcdef123456"

Different Receiver Types

Send to a Group (chat_id):

bash scripts/send_file.sh "/path/to/archive.zip" "oc_abcdef123456" "chat_id"

Supported types: open_id, user_id, chat_id, email.

Script Details

scripts/send_file.sh

The main script that handles the 3-step process:

  1. Auth: Obtains a tenant_access_token.
  2. Upload: Uploads the file to Feishu's internal storage using POST /im/v1/files.
  3. Send: Sends the file message using POST /im/v1/messages.

Permissions Required

The Feishu App must have the following permissions:

  • im:message (Send and receive messages)
  • im:message:send_as_bot (Send messages as bot)
  • im:resource (Access and upload resources)