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>`
Packaged view
This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.
Install command
npx @skill-hub/cli install openclaw-skills-feishu-img-tool
Repository
Skill path: skills/bo170814/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>`
Open repositoryBest for
Primary workflow: Ship Full Stack.
Technical facets: Full Stack.
Target audience: everyone.
License: Unknown.
Original source
Catalog source: SkillHub Club.
Repository owner: openclaw.
This is still a mirrored public skill entry. Review the repository before installing into production workflows.
What it helps with
- Install feishu-img-tool into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
- Review https://github.com/openclaw/skills before adding feishu-img-tool to shared team environments
- Use feishu-img-tool for development workflows
Works across
Favorites: 0.
Sub-skills: 0.
Aggregator: No.
Original source / Raw SKILL.md
---
name: feishu-img-tool
description: |
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>`
---
# 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",
"target": "ou_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"file_path": "/tmp/stock-report.png",
"message": "📊 今日股票报告"
}
```
### Send to current conversation (omit target)
```json
{
"action": "send",
"file_path": "/tmp/chart.png"
}
```
## Implementation Notes
- Uses Feishu SDK `@larksuiteoapi/node-sdk`
- `client.im.image.create()` for upload
- `client.im.message.create()` for sending
- `image_key` is permanent and can be reused by the same app
---
## Skill Companion Files
> Additional files collected from the skill directory layout.
### README.md
```markdown
# 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 '@larksuiteoapi/node-sdk'
确保 SDK 路径正确。默认路径:
```
/root/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@larksuiteoapi/node-sdk
```
如果路径变化,请更新脚本中的 `LARK_SDK_PATH`。
### 错误:Upload failed
检查:
1. 文件是否存在
2. 图片格式是否支持
3. 图片大小是否超过 10MB
4. 飞书应用配置是否正确
## 开发者
此技能由 ivan lee 开发,用于扩展飞书机器人的图片发送功能。
```
### _meta.json
```json
{
"owner": "bo170814",
"slug": "feishu-img-tool",
"displayName": "Feishu Img Tool",
"latest": {
"version": "1.0.1",
"publishedAt": 1772516114336,
"commit": "https://github.com/openclaw/skills/commit/8b2aa56068e3dd9c08c34105fa82da2522476afb"
},
"history": [
{
"version": "1.0.0",
"publishedAt": 1772446269892,
"commit": "https://github.com/openclaw/skills/commit/2d7e50132ec20c108b22581cefc5b1f5489f0dee"
}
]
}
```