用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/luokai0/ai-agent-skills-by-luo-kai --skill send-file命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Writers Room Story Engine mega-skill. Creates, structures, drafts, and revises compelling standalone stories from zero using premise generation, audience engagement, thematic design, character arcs, Story Spine structure, causal beats, worldbuilding in service of story, scene construction, and revision diagnostics. Use when developing short stories, standalone fiction, scripts, or narrative concepts from scratch or when improving weak drafts.
Browse Airtable bases and tables, inspect records, create records, and manage fields, comments, and table actions — powered by ClawLink.
Alibaba Cloud DNS (Alidns) CLI skill. Use to query, add, and update DNS records via aliyun-cli, including CNAME setup for Function Compute custom domains.
基于 SOC 职业分类
正在显示 SKILL.md
| name | send-file |
| description | 发送文件到消息平台。触发词:发送文件、发送文档、发送截图、传文件、发文件。支持飞书等平台,内容优先级:生成的文档 > 本地文件 > 截图。 |
将文件发送到消息平台(飞书、Telegram、Discord 等)。
内容来源优先级(用户未指定时):
使用前需要配置飞书应用凭证:
# 临时配置(当前终端)
export FEISHU_APP_ID='cli_xxx'
export FEISHU_APP_SECRET='xxx'
# 永久配置(添加到 ~/.zshrc 或 ~/.bashrc)
echo "export FEISHU_APP_ID='cli_xxx'" >> ~/.zshrc
echo "export FEISHU_APP_SECRET='xxx'" >> ~/.zshrc
source ~/.zshrc
获取飞书应用凭证:
im:message 和 im:resource 权限用户请求发送文件时:
用户: 把这个文件发到飞书
用户: 发送 /path/to/file.pdf 给我
用户: 把刚才生成的报告发给我
重要:飞书文件发送必须用 Python 脚本
⚠️ OpenClaw 的 message tool 无法直接发送本地文件(只能发链接)。
正确做法:直接执行 Python 脚本
python ~/.openclaw/skills/send-file/scripts/send_feishu_file.py <file_path> <open_id>
执行时机:
| 平台 | 状态 | 说明 |
|---|---|---|
| 飞书 | ✅ 支持 | 使用 message tool,支持多种文件类型 |
| Telegram | ✅ 支持 | 使用 message tool |
| Discord | ✅ 支持 | 使用 message tool |
| Signal | ✅ 支持 | 使用 message tool |
| 微信 | ⏳ 计划中 | 暂未原生支持 |
| ⏳ 计划中 | 暂未原生支持 |
当用户说"发文件"但未明确指定时,按优先级判断:
优先 1: 生成的文档
优先 2: 本地文件
发送 /path/to/file.pdf发送桌面的那个pdf → 需要搜索或确认read 确认文件存在优先 3: 截图
screencapture 命令当前对话自动推断
明确指定
发到飞书群xxx发到 Telegrammessage tool 的 channel 和 target 参数重要:飞书文件发送需要两步
飞书不能直接发送本地文件路径,必须先上传获取 file_key:
Step 3.1: 上传文件到飞书
# 1. 获取 tenant_access_token
# 2. 调用 POST /open-apis/im/v1/files 上传文件
# 3. 获取返回的 file_key
Step 3.2: 发送文件消息
# 调用 POST /open-apis/im/v1/messages?receive_id_type=open_id
# msg_type: "file"
# content: {"file_key": "<file_key>"}
Python 示例代码:
import requests
import json
# 1. 获取 token
token_resp = requests.post(
"https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal",
json={"app_id": APP_ID, "app_secret": APP_SECRET}
)
token = token_resp.json()["tenant_access_token"]
# 2. 上传文件
with open(file_path, 'rb') as f:
upload_resp = requests.post(
"https://open.feishu.cn/open-apis/im/v1/files",
headers={"Authorization": f"Bearer {token}"},
files={'file': (filename, f, mime_type)},
data={'file_type': file_type, 'file_name': filename}
)
file_key = upload_resp.json()["data"]["file_key"]
# 3. 发送文件消息
requests.post(
"https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"receive_id": open_id,
"msg_type": "file",
"content": json.dumps({"file_key": file_key})
}
)
file_type 对照表:
| 文件类型 | file_type |
|---|---|
| Excel (.xlsx/.xls) | xlsx |
| Word (.docx/.doc) | doc |
pdf | |
| 图片 | image |
| 视频 | video |
| 音频 | audio |
| 其他 | stream |
| 类型 | 扩展名 | 大小限制 |
|---|---|---|
| 文档 | pdf, doc, docx, xls, xlsx, ppt, pptx | 30MB |
| 图片 | jpg, jpeg, png, gif, webp | 20MB |
| 音频 | mp3, wav, m4a, aac | 30MB |
| 视频 | mp4, mov, avi | 50MB |
| 压缩包 | zip, rar, 7z | 30MB |
用户:把刚才生成的报告发到飞书
1. 确认生成的文件路径(通常是 workspace 目录)
2. 使用 message tool 发送
用户:发送 /Users/wlong/Desktop/report.pdf 给我
1. 确认文件存在
2. 使用 message tool 发送,target 留空(当前对话)
用户:截个屏发给我
1. 使用 screencapture 截图
2. 保存到临时文件
3. 使用 message tool 发送
飞书文件发送脚本,自动处理上传和发送流程。
用法:
python ~/.openclaw/skills/send-file/scripts/send_feishu_file.py <file_path> <open_id>
示例:
# 发送文件给用户
python ~/.openclaw/skills/send-file/scripts/send_feishu_file.py \
/Users/wlong/Downloads/report.xlsx \
ou_26b058ca29943e674a9b0c9039329897
环境变量:
FEISHU_APP_ID: 飞书应用 ID(必须配置)FEISHU_APP_SECRET: 飞书应用密钥(必须配置)通用文件发送辅助脚本(用于文件检查和验证)。