搜索

PythonReactSEOPDF
OpenClaw

feishu-img-tool

Feishu image upload and send tool. Send images to Feishu chats by uploading first then sending with image_key. Usage: `node feishu-image-tool.js send --target <open_id> --file <path>`

bo1708140 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install bo170814/feishu-img-tool

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

Feishu Image Tool

Tool feishu_image for uploading and sending images to Feishu chats.

How It Works

Feishu requires a two-step process to send images:

  1. Upload Image - Call /open-apis/im/v1/images to upload the image and get image_key
  2. Send Message - Call /open-apis/im/v1/messages with msg_type: "image" and the image_key

Actions

Upload and Send Image
{
  "action": "send",
  "target": "ou_xxx",  // User open_id or chat_id
  "file_path": "/path/to/image.png",
  "message": "Optional caption"
}

Parameters:

  • action: "send"
  • target: Feishu user open_id or chat_id (omit for current conversation)
  • file_path: Path to the image file on the server
  • message: Optional text message to send with the image

Returns:

  • success: boolean
  • image_key: The uploaded image key
  • message_id: The sent message ID
Upload Image Only
{
  "action": "upload",
  "file_path": "/path/to/image.png"
}

Returns image_key for later use.

Send Image with Key
{
  "action": "send_with_key",
  "target": "ou_xxx",
  "image_key": "img_v3_xxx"
}

Image Limits

  • Max size: 10 MB
  • Supported formats: JPG, JPEG, PNG, WEBP, GIF, BMP, ICO
  • Resolution:
    • GIF: max 2000 x 2000 pixels
    • Other formats: max 12000 x 12000 pixels

Configuration

Feishu App Credentials

Required credentials (in order of priority):

  1. Environment variables: FEISHU_APP_ID, FEISHU_APP_SECRET
  2. Config file: ~/.feishu-image/config.json
# Method 1: Environment variables
export FEISHU_APP_ID="cli_xxx"
export FEISHU_APP_SECRET="xxx"

# Method 2: Config file (~/.feishu-image/config.json)
{
  "appId": "cli_xxx",
  "appSecret": "xxx"
}
Required Permissions
  • im:message - Send messages as bot
  • im:image - Upload images

Permissions

  • im:message - Send messages as bot
  • im:image - Upload images

Example Usage

Send stock chart to user
{
  "action": "send",...

来源信息

Source
github
Repository
openclaw/skills
Path
skills/bo170814/feishu-img-tool
Version
—
Commit
51b5b2b974724aceef19d544202f04d6de6ab4da
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

README

Feishu Image Skill - 飞书图片发送技能

这个技能允许你在飞书中发送图片消息。

安装

clawhub install feishu-image-send

技能将安装到 ClawHub 技能目录。

使用方法

方法 1:直接使用 Node.js 脚本
# 发送图片给用户(带文字说明)
node feishu-image-tool.js send \
  --target ou_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
  --file /tmp/stock-report.png \
  --message "📊 今日股票报告"

# 仅上传图片,获取 image_key
node feishu-image-tool.js upload \
  --file /tmp/image.png

# 使用已有的 image_key 发送消息
node feishu-image-tool.js send-with-key \
  --target ou_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
  --image-key img_v3_xxx
方法 2:在 OpenClaw 中调用
const { exec } = require('child_process');

exec(`node feishu-image-tool.js send --target ${userId} --file ${filePath}`, (error, stdout, stderr) => {
  if (error) {
    console.error(`Error: ${error}`);
    return;
  }
  const result = JSON.parse(stdout);
  console.log('Image sent:', result.message_id);
});

配置

方法 1:环境变量(推荐)
export FEISHU_APP_ID="cli_xxxxxxxxxxxxxxxx"
export FEISHU_APP_SECRET="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
方法 2:配置文件

创建 ~/.feishu-image/config.json:

{
  "appId": "cli_xxxxxxxxxxxxxxxx",
  "appSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

可从示例配置复制:

cp config.example.json ~/.feishu-image/config.json
# 然后编辑 ~/.feishu-image/config.json 填入你的凭证
获取飞书应用凭证
  1. 访问 飞书开放平台
  2. 创建企业自建应用
  3. 获取 App ID 和 App Secret
  4. 确保应用有以下权限:
    • im:message - 发送消息
    • im:image - 上传图片

限制

  • 图片大小:最大 10 MB
  • 支持格式:JPG, JPEG, PNG, WEBP, GIF, BMP, ICO
  • 分辨率限制:
    • GIF: 最大 2000 x 2000 像素
    • 其他格式:最大 12000 x 12000 像素

输出示例

成功响应:

{
  "success": true,
  "image_key": "img_v3_02vd_xxx",
  "message_id": "om_x100b5560xxx"
}

故障排除

错误:Cannot find module '@lark...

来源内容

SKILL.md
# Feishu Image Tool

Tool `feishu_image` for uploading and sending images to Feishu chats.

## How It Works

Feishu requires a two-step process to send images:

1. **Upload Image** - Call `/open-apis/im/v1/images` to upload the image and get `image_key`
2. **Send Message** - Call `/open-apis/im/v1/messages` with `msg_type: "image"` and the `image_key`

## Actions

### Upload and Send Image

```json
{
  "action": "send",
  "target": "ou_xxx",  // User open_id or chat_id
  "file_path": "/path/to/image.png",
  "message": "Optional caption"
}
```

**Parameters:**
- `action`: `"send"`
- `target`: Feishu user open_id or chat_id (omit for current conversation)
- `file_path`: Path to the image file on the server
- `message`: Optional text message to send with the image

**Returns:**
- `success`: boolean
- `image_key`: The uploaded image key
- `message_id`: The sent message ID

### Upload Image Only

```json
{
  "action": "upload",
  "file_path": "/path/to/image.png"
}
```

Returns `image_key` for later use.

### Send Image with Key

```json
{
  "action": "send_with_key",
  "target": "ou_xxx",
  "image_key": "img_v3_xxx"
}
```

## Image Limits

- **Max size**: 10 MB
- **Supported formats**: JPG, JPEG, PNG, WEBP, GIF, BMP, ICO
- **Resolution**: 
  - GIF: max 2000 x 2000 pixels
  - Other formats: max 12000 x 12000 pixels

## Configuration

### Feishu App Credentials

Required credentials (in order of priority):
1. Environment variables: `FEISHU_APP_ID`, `FEISHU_APP_SECRET`
2. Config file: `~/.feishu-image/config.json`

```bash
# Method 1: Environment variables
export FEISHU_APP_ID="cli_xxx"
export FEISHU_APP_SECRET="xxx"

# Method 2: Config file (~/.feishu-image/config.json)
{
  "appId": "cli_xxx",
  "appSecret": "xxx"
}
```

### Required Permissions

- `im:message` - Send messages as bot
- `im:image` - Upload images

## Permissions

- `im:message` - Send messages as bot
- `im:image` - Upload images

## Example Usage

### Send stock chart to user

```json
{
  "action": "send",...
README
# Feishu Image Skill - 飞书图片发送技能

这个技能允许你在飞书中发送图片消息。

## 安装

```bash
clawhub install feishu-image-send
```

技能将安装到 ClawHub 技能目录。

## 使用方法

### 方法 1:直接使用 Node.js 脚本

```bash
# 发送图片给用户(带文字说明)
node feishu-image-tool.js send \
  --target ou_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
  --file /tmp/stock-report.png \
  --message "📊 今日股票报告"

# 仅上传图片,获取 image_key
node feishu-image-tool.js upload \
  --file /tmp/image.png

# 使用已有的 image_key 发送消息
node feishu-image-tool.js send-with-key \
  --target ou_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
  --image-key img_v3_xxx
```

### 方法 2:在 OpenClaw 中调用

```javascript
const { exec } = require('child_process');

exec(`node feishu-image-tool.js send --target ${userId} --file ${filePath}`, (error, stdout, stderr) => {
  if (error) {
    console.error(`Error: ${error}`);
    return;
  }
  const result = JSON.parse(stdout);
  console.log('Image sent:', result.message_id);
});
```

## 配置

### 方法 1:环境变量(推荐)

```bash
export FEISHU_APP_ID="cli_xxxxxxxxxxxxxxxx"
export FEISHU_APP_SECRET="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

### 方法 2:配置文件

创建 `~/.feishu-image/config.json`:

```json
{
  "appId": "cli_xxxxxxxxxxxxxxxx",
  "appSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
```

可从示例配置复制:
```bash
cp config.example.json ~/.feishu-image/config.json
# 然后编辑 ~/.feishu-image/config.json 填入你的凭证
```

### 获取飞书应用凭证

1. 访问 [飞书开放平台](https://open.feishu.cn/app)
2. 创建企业自建应用
3. 获取 App ID 和 App Secret
4. 确保应用有以下权限:
   - `im:message` - 发送消息
   - `im:image` - 上传图片

## 限制

- 图片大小:最大 10 MB
- 支持格式:JPG, JPEG, PNG, WEBP, GIF, BMP, ICO
- 分辨率限制:
  - GIF: 最大 2000 x 2000 像素
  - 其他格式:最大 12000 x 12000 像素

## 输出示例

成功响应:
```json
{
  "success": true,
  "image_key": "img_v3_02vd_xxx",
  "message_id": "om_x100b5560xxx"
}
```

## 故障排除

### 错误:Cannot find module '@lark...

相关技能

OpenClaw

geo-optimization

capt-marbles

Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discove...

OpenClaw

139mail

chang-tong

139邮箱邮件收发 Skill - 支持 IMAP/SMTP 协议,兼容139/QQ/163/Gmail等主流邮箱 功能: 1. 发送邮件(SMTP) 2. 接收邮件(IMAP) 3. 查看收件箱列表 4. 查看未读邮件 当用户提到 "发邮件"、"收邮件"、"查看邮件"、"邮箱"...