{
  "schemaVersion": "1.0",
  "item": {
    "slug": "feishu-send-file",
    "name": "Feishu Send File",
    "source": "tencent",
    "type": "skill",
    "category": "通讯协作",
    "sourceUrl": "https://clawhub.ai/dadaniya99/feishu-send-file",
    "canonicalUrl": "https://clawhub.ai/dadaniya99/feishu-send-file",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/feishu-send-file",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=feishu-send-file",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/send_file.py",
      "scripts/send_image.py",
      "skill.json"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/feishu-send-file"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/feishu-send-file",
    "agentPageUrl": "https://openagent3.xyz/skills/feishu-send-file/agent",
    "manifestUrl": "https://openagent3.xyz/skills/feishu-send-file/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/feishu-send-file/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "飞书发送文件",
        "body": "飞书机器人发送普通文件（非图片/视频）需要两步：先上传文件获取 file_key，再用 file_key 发消息。\n\n如果本地图片通过常规 message / media 路径发送后，用户在飞书里看到的是 /root/...png 路径文本而不是图片本体，不要继续重试同一种方式；直接改走本技能的稳定图片上传脚本。"
      },
      {
        "title": "方式一：用脚本（推荐）",
        "body": "python3 scripts/send_file.py <file_path> <open_id> <app_id> <app_secret> [file_name]\n\n参数说明：\n\nfile_path: 要发送的文件路径（HTML/PDF/ZIP/代码文件等）\nopen_id: 接收者的 open_id（从 inbound_meta 的 chat_id 字段获取，格式为 user:ou_xxx，取 ou_xxx 部分）\napp_id: 飞书应用 ID（从 openclaw.json 的 channels.feishu.appId 读取）\napp_secret: 飞书应用密钥（从 openclaw.json 的 channels.feishu.appSecret 读取）\nfile_name: 可选，自定义文件名（不填则用原文件名）\n\n快速获取配置：\n\n# 获取 app_id 和 app_secret\ngrep -A 2 '\"feishu\"' /root/.openclaw/openclaw.json | grep -E '(appId|appSecret)'\n\n完整示例：\n\npython3 /root/.openclaw/workspace/skills/feishu-send-file/scripts/send_file.py \\\n  /root/myfiles/report.html \\\n  <USER_OPEN_ID> \\\n  <YOUR_APP_ID> \\\n  <YOUR_APP_SECRET> \\\n  report.html\n\nAI 助手使用示例：\n\n# 当需要发送文件给用户时，直接调用脚本\nexec(f\"\"\"\npython3 /root/.openclaw/workspace/skills/feishu-send-file/scripts/send_file.py \\\\\n  {file_path} \\\\\n  {user_open_id} \\\\\n  {app_id} \\\\\n  {app_secret} \\\\\n  {custom_filename}\n\"\"\")"
      },
      {
        "title": "方式二：手动两步",
        "body": "Step 1 - 上传文件：\n\nTOKEN=$(curl -s -X POST \"https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"app_id\":\"<APP_ID>\",\"app_secret\":\"<APP_SECRET>\"}' | python3 -c \"import json,sys; print(json.load(sys.stdin)['tenant_access_token'])\")\n\nFILE_KEY=$(curl -s -X POST \"https://open.feishu.cn/open-apis/im/v1/files\" \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -F \"file_type=stream\" \\\n  -F \"file_name=<文件名>\" \\\n  -F \"file=@<文件路径>\" | python3 -c \"import json,sys; print(json.load(sys.stdin)['data']['file_key'])\")\n\nStep 2 - 发送消息：\n\ncurl -s -X POST \"https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id\" \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d \"{\\\"receive_id\\\":\\\"<OPEN_ID>\\\",\\\"msg_type\\\":\\\"file\\\",\\\"content\\\":\\\"{\\\\\\\"file_key\\\\\\\":\\\\\\\"$FILE_KEY\\\\\\\"}\\\"}\""
      },
      {
        "title": "什么时候不要再硬用 message + media",
        "body": "如果你把本地图片路径（尤其是 /root/myfiles/...）传给飞书消息链路后，用户在飞书里看到的是：\n\n📎 /root/myfiles/xxx.png\n或纯本地路径文本\n\n那就说明这次没有真正发成图片。不要继续重试同一种参数组合。"
      },
      {
        "title": "原因（真实世界版）",
        "body": "飞书真正的图片消息不是“把本地路径塞给消息发送器”\n正路是：先上传到 im/v1/images，拿到 image_key，再发送 msg_type=image\nOpenClaw / Feishu 插件在某些本地路径场景下（特别是 /root/myfiles/...）可能无法走通本地媒体上传链路，随后自动降级成把路径文本发出去\n所以：messageId 返回成功 不等于 用户真的看到了图片"
      },
      {
        "title": "成功标准",
        "body": "只有一个成功标准：用户在飞书里实际看到图片本体。\n\n如果回显的是路径文本，就视为失败。"
      },
      {
        "title": "推荐脚本（稳定版）",
        "body": "python3 scripts/send_image.py <image_path> <open_id> <app_id> <app_secret> [domain]\n\n示例：\n\npython3 /root/.openclaw/workspace/skills/feishu-send-file/scripts/send_image.py \\\n  /root/myfiles/generated-images/demo.png \\\n  <USER_OPEN_ID> \\\n  <YOUR_APP_ID> \\\n  <YOUR_APP_SECRET>\n\n如果是国际版 Lark：\n\npython3 scripts/send_image.py <image_path> <open_id> <app_id> <app_secret> lark"
      },
      {
        "title": "这和普通文件的区别",
        "body": "普通文件：im/v1/files -> file_key -> msg_type=file\n图片：im/v1/images -> image_key -> msg_type=image\n\n这两条链路不要混用。"
      },
      {
        "title": "注意事项",
        "body": "普通文件：必须走本技能的两步流程，直接用 filePath 参数只会显示路径\n图片：理论上 message tool 的 media 参数可以工作；但如果用户看到的是路径文本而不是图片本体，立刻改用 scripts/send_image.py\n不要把 /root/myfiles/... 本地路径回显误判为发送成功\nreceive_id_type=open_id 对应个人用户；群聊用 chat_id 并替换类型\n飞书 file_type 用 stream 适用于所有普通文件类型"
      }
    ],
    "body": "飞书发送文件\n\n飞书机器人发送普通文件（非图片/视频）需要两步：先上传文件获取 file_key，再用 file_key 发消息。\n\n如果本地图片通过常规 message / media 路径发送后，用户在飞书里看到的是 /root/...png 路径文本而不是图片本体，不要继续重试同一种方式；直接改走本技能的稳定图片上传脚本。\n\n快速流程\n方式一：用脚本（推荐）\npython3 scripts/send_file.py <file_path> <open_id> <app_id> <app_secret> [file_name]\n\n\n参数说明：\n\nfile_path: 要发送的文件路径（HTML/PDF/ZIP/代码文件等）\nopen_id: 接收者的 open_id（从 inbound_meta 的 chat_id 字段获取，格式为 user:ou_xxx，取 ou_xxx 部分）\napp_id: 飞书应用 ID（从 openclaw.json 的 channels.feishu.appId 读取）\napp_secret: 飞书应用密钥（从 openclaw.json 的 channels.feishu.appSecret 读取）\nfile_name: 可选，自定义文件名（不填则用原文件名）\n\n快速获取配置：\n\n# 获取 app_id 和 app_secret\ngrep -A 2 '\"feishu\"' /root/.openclaw/openclaw.json | grep -E '(appId|appSecret)'\n\n\n完整示例：\n\npython3 /root/.openclaw/workspace/skills/feishu-send-file/scripts/send_file.py \\\n  /root/myfiles/report.html \\\n  <USER_OPEN_ID> \\\n  <YOUR_APP_ID> \\\n  <YOUR_APP_SECRET> \\\n  report.html\n\n\nAI 助手使用示例：\n\n# 当需要发送文件给用户时，直接调用脚本\nexec(f\"\"\"\npython3 /root/.openclaw/workspace/skills/feishu-send-file/scripts/send_file.py \\\\\n  {file_path} \\\\\n  {user_open_id} \\\\\n  {app_id} \\\\\n  {app_secret} \\\\\n  {custom_filename}\n\"\"\")\n\n方式二：手动两步\n\nStep 1 - 上传文件：\n\nTOKEN=$(curl -s -X POST \"https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"app_id\":\"<APP_ID>\",\"app_secret\":\"<APP_SECRET>\"}' | python3 -c \"import json,sys; print(json.load(sys.stdin)['tenant_access_token'])\")\n\nFILE_KEY=$(curl -s -X POST \"https://open.feishu.cn/open-apis/im/v1/files\" \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -F \"file_type=stream\" \\\n  -F \"file_name=<文件名>\" \\\n  -F \"file=@<文件路径>\" | python3 -c \"import json,sys; print(json.load(sys.stdin)['data']['file_key'])\")\n\n\nStep 2 - 发送消息：\n\ncurl -s -X POST \"https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id\" \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d \"{\\\"receive_id\\\":\\\"<OPEN_ID>\\\",\\\"msg_type\\\":\\\"file\\\",\\\"content\\\":\\\"{\\\\\\\"file_key\\\\\\\":\\\\\\\"$FILE_KEY\\\\\\\"}\\\"}\"\n\n稳定发送图片（2026-03-15 补充）\n什么时候不要再硬用 message + media\n\n如果你把本地图片路径（尤其是 /root/myfiles/...）传给飞书消息链路后，用户在飞书里看到的是：\n\n📎 /root/myfiles/xxx.png\n或纯本地路径文本\n\n那就说明这次没有真正发成图片。不要继续重试同一种参数组合。\n\n原因（真实世界版）\n飞书真正的图片消息不是“把本地路径塞给消息发送器”\n正路是：先上传到 im/v1/images，拿到 image_key，再发送 msg_type=image\nOpenClaw / Feishu 插件在某些本地路径场景下（特别是 /root/myfiles/...）可能无法走通本地媒体上传链路，随后自动降级成把路径文本发出去\n所以：messageId 返回成功 不等于 用户真的看到了图片\n成功标准\n\n只有一个成功标准：用户在飞书里实际看到图片本体。\n\n如果回显的是路径文本，就视为失败。\n\n推荐脚本（稳定版）\npython3 scripts/send_image.py <image_path> <open_id> <app_id> <app_secret> [domain]\n\n\n示例：\n\npython3 /root/.openclaw/workspace/skills/feishu-send-file/scripts/send_image.py \\\n  /root/myfiles/generated-images/demo.png \\\n  <USER_OPEN_ID> \\\n  <YOUR_APP_ID> \\\n  <YOUR_APP_SECRET>\n\n\n如果是国际版 Lark：\n\npython3 scripts/send_image.py <image_path> <open_id> <app_id> <app_secret> lark\n\n这和普通文件的区别\n普通文件：im/v1/files -> file_key -> msg_type=file\n图片：im/v1/images -> image_key -> msg_type=image\n\n这两条链路不要混用。\n\n注意事项\n普通文件：必须走本技能的两步流程，直接用 filePath 参数只会显示路径\n图片：理论上 message tool 的 media 参数可以工作；但如果用户看到的是路径文本而不是图片本体，立刻改用 scripts/send_image.py\n不要把 /root/myfiles/... 本地路径回显误判为发送成功\nreceive_id_type=open_id 对应个人用户；群聊用 chat_id 并替换类型\n飞书 file_type 用 stream 适用于所有普通文件类型"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/dadaniya99/feishu-send-file",
    "publisherUrl": "https://clawhub.ai/dadaniya99/feishu-send-file",
    "owner": "dadaniya99",
    "version": "1.2.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/feishu-send-file",
    "downloadUrl": "https://openagent3.xyz/downloads/feishu-send-file",
    "agentUrl": "https://openagent3.xyz/skills/feishu-send-file/agent",
    "manifestUrl": "https://openagent3.xyz/skills/feishu-send-file/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/feishu-send-file/agent.md"
  }
}