← 返回 Skills 市场
2656255594

Local File Sender

作者 2656255594 · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ⚠ suspicious
104
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install local-file-sender
功能描述
本地文件发送工具。用户通过自然语言指定本地文件路径,将文件上传到云存储并发送下载链接。支持 Windows/Linux/macOS 路径格式。⚠️ 仅适用于本地部署的 OpenClaw,云端部署无法访问用户本地文件。
使用说明 (SKILL.md)

本地文件发送工具

⚠️ 重要说明

此 skill 仅适用于本地部署的 OpenClaw!

  • 本地部署:可以访问本地文件系统,支持此功能
  • 云端部署:无法访问用户本地文件,不支持此功能

云端用户替代方案

  1. 直接在聊天中上传文件
  2. 使用飞书/企业微信自带的文件发送功能

功能说明

将本地文件上传到云存储并发送下载链接,用户只需通过自然语言指定文件路径。

触发场景

当用户说以下类似语句时触发:

  • "把 E:\校对\报告.xlsx 发给飞书"
  • "发送 C:\Users\Documents\report.pdf 到飞书"
  • "把 /home/user/report.xlsx 发给我"
  • "发送这个文件到飞书:D:\项目\数据.xlsx"

执行步骤

当收到用户的文件发送请求时,按以下步骤处理:

步骤 1:识别文件路径

从用户消息中提取文件路径,支持以下格式:

Windows 路径

  • E:\校对\报告.xlsx
  • C:\Users\用户名\Documents\file.pdf
  • D:\项目\2024\数据.xlsx

Linux/macOS 路径

  • /home/user/report.xlsx
  • /Users/用户名/Documents/file.pdf
  • ~/Documents/report.xlsx

步骤 2:规范化路径

import os

# 处理用户目录
if path.startswith('~'):
    path = os.path.expanduser(path)

# Windows 路径处理
path = os.path.normpath(path)

# 获取绝对路径
path = os.path.abspath(path)

步骤 3:检查文件

使用 exec 工具检查文件是否存在:

Windows PowerShell

Test-Path "E:\校对\报告.xlsx"
Get-Item "E:\校对\报告.xlsx" | Select-Object Name, Length, LastWriteTime

Linux/macOS

ls -la "/home/user/report.xlsx"

步骤 4:上传文件到云存储

重要:飞书等平台不支持直接发送本地文件路径,必须先上传到云存储。

使用 lightclaw_upload_file 工具上传文件:

{
  "paths": ["E:\\校对\\报告.xlsx"]
}

该工具会返回公开的下载链接。

步骤 5:发送下载链接

上传成功后,发送包含下载链接的消息:

📄 文件已上传,请点击下载:
[报告.xlsx](下载链接)

完整示例

用户请求

把 E:\校对\报告.xlsx 发给飞书

AI 处理流程

  1. 识别路径E:\校对\报告.xlsx

  2. 检查文件

    Test-Path "E:\校对\报告.xlsx"
    
  3. 上传文件

    {
      "paths": ["E:\\校对\\报告.xlsx"]
    }
    
  4. 发送结果

    ✅ 文件已上传,请点击下载:
    [报告.xlsx](https://xxx.lightclaw.com/xxx)
    

错误处理

文件不存在

❌ 文件不存在: E:\校对\报告.xlsx
请检查路径是否正确。

权限不足

❌ 无法读取文件: C:\System\config.dat
权限不足,请检查文件访问权限。

文件过大

⚠️ 文件较大 (150MB),上传可能需要较长时间...
正在上传中...

云端部署提示

⚠️ 当前为云端部署,无法访问您的本地文件。

替代方案:
1. 直接在聊天中上传文件
2. 使用飞书自带的文件发送功能

技术说明

为什么不能直接用 message 发送本地文件?

飞书、企业微信等平台的 Bot API 不支持直接发送本地文件路径。必须通过以下方式之一:

  1. 上传到云存储(本 skill 采用的方式)

    • 使用 lightclaw_upload_file 上传
    • 返回公开下载链接
    • 用户点击链接下载
  2. 使用平台专用上传 API

    • 飞书:需要先调用文件上传 API 获取 file_key
    • 企业微信:需要调用媒体文件上传接口

本 skill 选择方案 1,因为它:

  • 不需要各平台专用的 API 配置
  • 支持所有平台(飞书、企业微信、Telegram 等)
  • 用户可以通过链接重复下载

注意事项

  1. 必须本地部署:此 skill 需要在能够访问本地文件系统的环境中运行
  2. 文件大小限制:上传服务可能有大小限制
  3. 路径格式:Windows 路径使用反斜杠 \,Linux/macOS 使用正斜杠 /
  4. 中文路径:支持中文路径和文件名
  5. 云端限制:云端部署无法访问用户本地文件,需使用替代方案
  6. 链接有效期:下载链接可能有时效限制,建议及时下载
安全使用建议
This skill does what it says (uploads local files and returns links), but it also can upload any file you point it at to an external service whose ownership/configuration is not documented. Before installing or using: 1) only enable this on a trusted local deployment (not cloud); 2) ask the skill developer/operator: where are files uploaded, who controls the storage, are links public, what is retention/expiration, and are credentials required; 3) require an explicit user confirmation step before uploading any file (especially for system or config directories); 4) avoid using it for sensitive files (credentials, system configs, PII) unless you have validated the storage/security posture; 5) consider restricting automatic invocation so uploads cannot happen without your interactive approval.
功能分析
Type: OpenClaw Skill Name: local-file-sender Version: 1.0.2 The 'local-file-sender' skill enables an AI agent to upload arbitrary local files to a cloud storage service via the 'lightclaw_upload_file' tool and generate public download links. While intended as a utility for local deployments, the skill lacks any path sanitization or restrictions on sensitive directories (e.g., SSH keys, cloud credentials, or system configs), creating a significant risk for data exfiltration through prompt injection. The instructions in SKILL.md explicitly guide the agent to normalize and resolve absolute paths to facilitate these external uploads.
能力评估
Purpose & Capability
The name/description (send local files to cloud storage and return a link) matches the SKILL.md steps: extract path, check file exists, call lightclaw_upload_file with the path, then send the link. The declared requirement 'deployment: local' is appropriate. The referenced tool lightclaw_upload_file is consistent with the stated goal, though its provenance is not described.
Instruction Scope
Runtime instructions explicitly run shell commands (Test-Path / ls) and upload whatever path the user supplies. There are no explicit safeguards: no confirmation step, no whitelisting/blacklisting of sensitive locations, no size/content validation beyond a generic 'file too large' message. Because the skill will accept arbitrary paths and upload them to an external service, it can unintentionally exfiltrate sensitive local files if misused or invoked without clear user consent.
Install Mechanism
Instruction-only skill with no install spec or code files — lowest install risk. Nothing is written to disk by the skill itself according to provided metadata.
Credentials
No environment variables or credentials are declared, yet the SKILL.md relies on a tool (lightclaw_upload_file) that will upload files to a cloud service and return public links (example domain shown). The skill does not document who controls the upload endpoint, what credentials or API keys are used, or whether uploads are private. The absence of declared credentials or configuration for the upload service is a gap and makes it impossible to verify proportionality or trustworthiness of the destination.
Persistence & Privilege
The skill is not always-enabled and is user-invocable, which is normal. However, since the platform allows autonomous invocation by default, combining that with an ability to read local paths and upload them externally increases potential blast radius — consider restricting autonomous invocation or requiring explicit confirmation before any upload.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install local-file-sender
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /local-file-sender 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
修复:使用 lightclaw_upload_file 上传文件到云存储,解决飞书等平台不支持直接发送本地文件的问题
v1.0.1
更新文档说明
v1.0.0
初始版本:支持通过自然语言将本地文件发送到飞书/企业微信等平台
元数据
Slug local-file-sender
版本 1.0.2
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

Local File Sender 是什么?

本地文件发送工具。用户通过自然语言指定本地文件路径,将文件上传到云存储并发送下载链接。支持 Windows/Linux/macOS 路径格式。⚠️ 仅适用于本地部署的 OpenClaw,云端部署无法访问用户本地文件。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 104 次。

如何安装 Local File Sender?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install local-file-sender」即可一键安装,无需额外配置。

Local File Sender 是免费的吗?

是的,Local File Sender 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Local File Sender 支持哪些平台?

Local File Sender 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Local File Sender?

由 2656255594(@2656255594)开发并维护,当前版本 v1.0.2。

💬 留言讨论