← Back to Skills Marketplace
andersonhjb

feishu-image-sender

by AI悦创Python一对一辅导 · GitHub ↗ · v0.0.3 · MIT-0
cross-platform ⚠ suspicious
375
Downloads
1
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install feishu-image-sent
Description
飞书图片发送工具,支持系统截屏、区域截图和本地图片文件发送到飞书工作区,方便快速分享屏幕内容。
README (SKILL.md)

feishu-image-sender - 飞书图片发送技能

飞书图片发送工具,支持系统截图和本地图片发送到飞书。

📌 技能位置

统一管理目录: /opt/homebrew/lib/node_modules/openclaw/skills/feishu-image-sender/

功能特性

  • 🖥️ 系统截图 - 截取整个电脑屏幕
  • 📐 区域截图 - 支持指定截图区域
  • 🖼️ 本地图片发送 - 发送本地图片文件到飞书
  • 📱 即时发送 - 截图后可直接发送到飞书
  • 🎯 自动化流程 - 标准化的图片发送流程

使用场景

  • 需要分享当前屏幕内容
  • 截取错误界面或问题截图
  • 制作教程或演示截图
  • 发送本地图片文件到飞书
  • 远程协助时分享屏幕

核心功能

1. 系统截图并发送

# 完整的截图并发送流程
def screenshot_and_send():
    # 1. 系统截图
    exec(command="/usr/sbin/screencapture -t png /tmp/screenshot.png")
    
    # 2. 移动到工作空间
    exec(command="cp /tmp/screenshot.png /Users/bornforthis/.openclaw/workspace/")
    
    # 3. 发送到飞书
    message(action="send", media="/Users/bornforthis/.openclaw/workspace/screenshot.png")

2. 发送本地图片

# 发送本地图片文件
def send_local_image(image_path):
    # 检查文件是否存在
    if not os.path.exists(image_path):
        return "图片文件不存在"
    
    # 移动到工作空间(如果需要)
    workspace_path = "/Users/bornforthis/.openclaw/workspace/" + os.path.basename(image_path)
    exec(command=f"cp '{image_path}' '{workspace_path}'")
    
    # 发送到飞书
    message(action="send", media=workspace_path)
    return "图片发送成功"

3. 交互式截图

# 交互式区域截图
def interactive_screenshot():
    exec(command="/usr/sbin/screencapture -i -c -t png /tmp/interactive_screenshot.png")
    exec(command="cp /tmp/interactive_screenshot.png /Users/bornforthis/.openclaw/workspace/")
    message(action="send", media="/Users/bornforthis/.openclaw/workspace/interactive_screenshot.png")

使用方法

方法1: 快速截图并发送

# 使用feishu-image-screenshot命令快速截图并发送
exec(command="feishu-image-screenshot")

方法2: 发送指定图片

# 发送指定路径的图片
exec(command="feishu-image-send /path/to/image.png")

方法3: 交互式截图

# 交互式选择区域截图
exec(command="feishu-image-interactive")

参数说明

截图参数

  • 格式: PNG (推荐,无损压缩)
  • 质量: PNG 保持最佳质量,适合技术截图
  • 延迟: 可添加延迟避免截取到快照界面
  • 区域: 支持全屏、交互式选择区域

发送参数

  • 文件路径: 必须是工作空间目录下的文件
  • 文件格式: 支持 PNG、JPEG、GIF 等常见图片格式
  • 文件大小: 建议不超过 10MB

最佳实践

  1. 使用 PNG 格式 - 保持最佳质量,适合技术截图
  2. 添加适当延迟 - 避免截取到过渡状态
  3. 文件命名规范 - 使用时间戳避免重复
  4. 智能压缩 - 如果图片过大,会自动先压缩上传一次,再原图上传一次。小图片则不压缩直接发送。
  5. 路径规范 - 文件必须保存到工作空间目录

常见问题

Q: 截图为空白

A: 确保使用系统级截图命令,而不是浏览器截图

Q: 截图模糊

A: 使用 PNG 格式,避免 JPEG 压缩

Q: 截图不完整

A: 检查屏幕分辨率设置,使用全屏截图模式

Q: 文件路径被拒绝

A: 飞书发送时需要将文件移动到允许的目录,如工作空间目录

Q: screencapture 命令找不到

A: 在 macOS 上使用完整路径:

/usr/sbin/screencapture -t png /tmp/screenshot.png

示例脚本

feishu-image-screenshot (截图并发送)

#!/bin/bash
# 飞书图片发送 - 系统截图并发送

TIMESTAMP=$(date +%Y%m%d_%H%M%S)
FILENAME="/tmp/screenshot_${TIMESTAMP}.png"

# 截图
/usr/sbin/screencapture -x -t png "$FILENAME"

# 移动到工作空间
cp "$FILENAME" "/Users/bornforthis/.openclaw/workspace/screenshot_${TIMESTAMP}.png"

# 发送到飞书
message(action="send", media="/Users/bornforthis/.openclaw/workspace/screenshot_${TIMESTAMP}.png")

# 清理临时文件
rm "$FILENAME"

echo "截图已发送到飞书"

feishu-image-send (发送指定图片)

#!/bin/bash
# 飞书图片发送 - 发送指定图片

if [ $# -eq 0 ]; then
    echo "请提供图片路径"
    exit 1
fi

IMAGE_PATH="$1"
if [ ! -f "$IMAGE_PATH" ]; then
    echo "图片文件不存在: $IMAGE_PATH"
    exit 1
fi

# 获取文件名
FILENAME=$(basename "$IMAGE_PATH")
WORKSPACE_PATH="/Users/bornforthis/.openclaw/workspace/$FILENAME"

# 复制到工作空间
cp "$IMAGE_PATH" "$WORKSPACE_PATH"

# 发送到飞书
message(action="send", media="$WORKSPACE_PATH")

echo "图片已发送到飞书: $FILENAME"

feishu-image-interactive (交互式截图)

#!/bin/bash
# 飞书图片发送 - 交互式截图

TIMESTAMP=$(date +%Y%m%d_%H%M%S)
FILENAME="/tmp/interactive_${TIMESTAMP}.png"

# 交互式截图
/usr/sbin/screencapture -i -t png "$FILENAME"

if [ -f "$FILENAME" ]; then
    # 移动到工作空间
    cp "$FILENAME" "/Users/bornforthis/.openclaw/workspace/interactive_${TIMESTAMP}.png"
    
    # 发送到飞书
    message(action="send", media="/Users/bornforthis/.openclaw/workspace/interactive_${TIMESTAMP}.png")
    
    # 清理临时文件
    rm "$FILENAME"
    
    echo "交互式截图已发送到飞书"
else
    echo "用户取消截图"
fi

集成到OpenClaw

在Python脚本中使用

import subprocess

def send_image_to_feishu(image_path):
    """发送图片到飞书"""
    # 复制到工作空间
    workspace_path = "/Users/bornforthis/.openclaw/workspace/" + os.path.basename(image_path)
    subprocess.run(["cp", image_path, workspace_path])
    
    # 发送到飞书
    message(action="send", media=workspace_path)

def take_screenshot_and_send():
    """截图并发送到飞书"""
    import time
    timestamp = int(time.time())
    temp_path = f"/tmp/screenshot_{timestamp}.png"
    workspace_path = f"/Users/bornforthis/.openclaw/workspace/screenshot_{timestamp}.png"
    
    # 截图
    subprocess.run(["/usr/sbin/screencapture", "-x", "-t", "png", temp_path])
    
    # 移动并发送
    subprocess.run(["cp", temp_path, workspace_path])
    message(action="send", media=workspace_path)
    
    # 清理
    subprocess.run(["rm", temp_path])

支持的图片格式

  • PNG - 无损压缩,推荐用于技术截图
  • JPEG - 有损压缩,适合照片类图片
  • GIF - 动图支持
  • WebP - 现代图片格式
  • BMP - 无压缩格式

性能优化

  1. 文件大小控制 - 大图片建议压缩到10MB以内
  2. 格式选择 - 技术截图用PNG,照片类用JPEG
  3. 批量处理 - 支持批量发送多张图片
  4. 缓存机制 - 避免重复发送相同图片

注意: 此技能优先使用系统级截图方法,确保截图的真实性和完整性,并遵循标准化的图片发送流程。

Usage Guidance
This skill mostly does what it claims (take screenshots, compress, and send), but there are several red flags you should resolve before installing: - Platform & OS: The scripts call /usr/sbin/screencapture and sips (macOS). If you are not on macOS this will fail; the skill's metadata does not declare this requirement. - Undeclared dependencies: The code requires python3 and the Pillow (PIL) library. Add these to the requirements or install them first. - Missing Feishu auth explanation: The code calls a message(action='send', media=...) via a 'message' module but does not document how Feishu credentials or tokens are provided. Confirm where the message API comes from (OpenClaw runtime?) and how authentication is performed. Do not provide Feishu or other tokens until you verify how they are stored and used. - Hard-coded paths: The skill hard-codes /Users/bornforthis/.openclaw/workspace and an install path. Update config (settings.sh) to point at your actual home/workspace and verify file permissions. - No install step: The package provides scripts but no install mechanism to place them on PATH; either run them with explicit paths or add a safe install step. - Privacy risk: Screenshots can capture sensitive info. Only run this skill in environments where you trust the runtime and have control over where images are sent. Recommended actions before use: inspect/grep the runtime for where 'message' is implemented, add/require explicit environment variables for any Feishu credentials, update settings.sh to your paths, and test in a controlled environment. If you can't confirm the origin/behavior of the 'message' API or how authentication is handled, treat the skill as risky and avoid granting it network/credential access.
Capability Analysis
Type: OpenClaw Skill Name: feishu-image-sent Version: 0.0.3 The skill bundle contains a significant command injection vulnerability in 'improved/utils.py' where filenames are unsafely interpolated into a 'python -c' execution string within a subprocess call. Additionally, the code contains numerous hardcoded absolute paths tied to a specific local user ('/Users/bornforthis/'), which is highly irregular for a portable skill bundle and suggests it was either exfiltrated from a specific environment or poorly authored. While the stated purpose of taking and sending screenshots is functional, the lack of input sanitization and the use of high-privilege system commands (screencapture) make it a security risk.
Capability Assessment
Purpose & Capability
Name/description: send screenshots/images to Feishu — matches most of the code. But the package declares no required binaries, env vars, or OS restriction while the scripts actually require macOS tools (/usr/sbin/screencapture, sips), python3, and Pillow. The code also hard-codes a user workspace path (/Users/bornforthis/.openclaw/workspace) and a different skill install path (/opt/homebrew/...), which is not portable and inconsistent with the claimed metadata.
Instruction Scope
Runtime instructions and scripts perform screenshots, copy files into a per-user workspace, compress images, and call message(action='send', media=...). They do not read arbitrary system config files, nor do they reach out to arbitrary network endpoints in the code provided. However the skill assumes the existence of a platform 'message' API (imported dynamically) and does not document required credentials if network/Feishu API access is needed. The hard-coded user path and the expectation that CLI commands like feishu-image-screenshot are available (no install step) are scope/operational issues.
Install Mechanism
No install spec is declared, yet the bundle contains multiple scripts that expect to be invoked as commands. There is no documented installation step to place these scripts on PATH or mark them executable. This mismatch makes the skill brittle and confusing for users and operators.
Credentials
The skill declares no required environment variables or credentials, yet sending messages to Feishu normally requires authentication. The code calls a 'message' function via a dynamic import (from message import message) without explaining where credentials/tokens are configured. Required external tools (screencapture, sips) and Python/Pillow are also not declared. Missing declarations are disproportionate to the task and leave unclear how Feishu auth is provided.
Persistence & Privilege
The skill does not request always: true and does not modify other skills or system configs. It creates and writes files to a user workspace and /tmp (expected for screenshots). This is within expected privilege for a screenshot-and-send tool, though users should be aware screenshots can contain sensitive data.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install feishu-image-sent
  3. After installation, invoke the skill by name or use /feishu-image-sent
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.0.3
Version 0.0.3 - 新增 improved/config/settings.sh 配置文件 - 为后续优化或自定义配置做准备,当前并无对核心流程和功能的更动 - 其余功能与说明未作修改,兼容原有用法
v0.0.2
- Initial release of reworked and modularized feishu-image-sent skill. - Added improved Bash and Python scripts for sending images and screenshots to Feishu. - New `improved/` directory with organized configuration, scripts, and utilities. - Added support for interactive screenshot, full screenshot, and direct local image sending. - Added config file for customizable settings. - Enhanced documentation and best practices in SKILL.md, including new notes about automatic image compression for large files.
v0.0.1
初始化 Skills 发布第一个 Skills
Metadata
Slug feishu-image-sent
Version 0.0.3
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is feishu-image-sender?

飞书图片发送工具,支持系统截屏、区域截图和本地图片文件发送到飞书工作区,方便快速分享屏幕内容。 It is an AI Agent Skill for Claude Code / OpenClaw, with 375 downloads so far.

How do I install feishu-image-sender?

Run "/install feishu-image-sent" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is feishu-image-sender free?

Yes, feishu-image-sender is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does feishu-image-sender support?

feishu-image-sender is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created feishu-image-sender?

It is built and maintained by AI悦创Python一对一辅导 (@andersonhjb); the current version is v0.0.3.

💬 Comments