feishu_file_fetch
Implements a Clawdbot extension tool that downloads Feishu files by message_id and file_key, streams to disk with sha256, size limits, and path traversal protection. Use when the user asks to build or update the feishu_file_fetch tool, Feishu file download workflow, or Clawdbot extension handling message_id/file_key inputs.
- License 许可
- MIT
- 最近更新
- 2026-08-23
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- feishu_file_fetch
- description
- Implements a Clawdbot extension tool that downloads Feishu files by message_id and file_key, streams to disk with sha256, size limits, and path traversal protection. Use when the user asks to build or update the feishu_file_fetch tool, Feishu file download workflow, or Clawdbot extension handling message_id/file_key inputs.
02 资源文件 4
- 参考文档_meta.json293 B
- 参考文档README.md6.3 KB
- 参考文档reference.md821 B
- 脚本scripts/feishu_file_fetch.py6.3 KB
03 SKILL.md 正文
feishu_file_fetch
Quick start
Create or update the reference implementation at scripts/feishu_file_fetch.py. It should:
- Accept JSON input:
{ message_id, file_key, type="file", outdir="/root/clawd/uploads", max_bytes=104857600 } - Output JSON:
{ ok, path, filename, bytes, sha256, error? } - Use
FEISHU_APP_ID/FEISHU_APP_SECRETto fetch and cachetenant_access_token(refresh 2 minutes before expiry). - Download via
GET https://open.feishu.cn/open-apis/im/v1/messages/{message_id}/resources/{file_key}?type={type}withAuthorization: Bearer <token>. - Stream to
outdir/yyyyMMdd/, parse filename fromContent-Disposition, fallback tofile_key.bin. - Compute sha256 while streaming; enforce
max_bytesstrictly (terminate and delete temp file if exceeded). - Prevent path traversal by ensuring final path stays within
outdir. - Never log tokens or secrets.
Runtime notes
- Use only stdlib to avoid dependency installs.
- If
Content-Lengthexceedsmax_bytes, fail early. - Use a temp file in the target directory and
os.replaceon success.
Example usage
echo '{"message_id":"om_xxx","file_key":"file_xxx"}' | python scripts/feishu_file_fetch.py
Additional resources
- For API details and error handling notes, see reference.md
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.
git-summary
Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.
agent-constitution
Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.