附件上传会把本地文件内容发送到飞书
原文依据:4 处该命令读取当前工作目录中的相对路径文件,并上传到指定任务或任务智能体。路径限制能阻止目录逃逸,但不能判断文件是否包含密钥、客户资料或其他敏感内容。
如果选择了错误文件、任务 GUID 或任务智能体,文件内容可能被对该飞书资源有访问权的其他成员看到。
该功能会读取当前工作目录中的一个本地文件,并将其上传到指定的飞书任务或任务智能体。相对路径、目录限制和 50 MB 上限降低了任意文件读取风险,且流程要求先确认目标与路径;但文档没有要求检查文件是否含凭据或敏感资料。若用户或智能体选错文件,内容会离开本机并对任务可访问者可见。用户可要求上传前明确显示文件名、目标任务和敏感信息检查结果。
|-----------|----------|-------------|| `--resource-id <guid_or_applink>` | Yes | Target resource GUID. Accepts a raw task GUID or a Feishu task applink URL (`.../client/todo/task?guid=...`); the `guid` query parameter is extracted automatically. Do not use `suite_entity_num` / display IDs like `t104121`. || `--file <path>` | Yes | Local file path to upload. Must be a relative path within the current working directory; absolute paths and paths escaping the cwd are rejected. Single file only, ≤ 50 MB. || `--resource-type <type>` | No | Owning resource type. Defaults to `task`. Use `task_delivery` when uploading to task agents. || `--user-id-type <type>` | No | User ID type for the request. Defaults to `open_id`. |查看另外 3 个位置
1. Confirm the target task GUID (or applink) and the local file path with the user.2. Ensure the file is within the current working directory and its size is ≤ 50 MB; otherwise ask the user to move/split the file.3. Determine if this is a task agent: if yes, add `--resource-type task_delivery`.4. Execute `lark-cli task +upload-attachment --resource-id "..." --file "..."`.5. Report the returned attachment record. The output exposes all fields returned by the API (e.g. `guid`, `name`, `size`, `url`, `uploader`, ...); always surface the attachment `guid` and, if present, the `url` so the user can jump to the attachment directly.Upload a single local file as an attachment to a task (or any resource type accepted by the Task attachment endpoint). Max file size per upload is **50 MB**. For task agents, use `--resource-type=task_delivery`.| `--resource-id <guid_or_applink>` | Yes | Target resource GUID. Accepts a raw task GUID or a Feishu task applink URL (`.../client/todo/task?guid=...`); the `guid` query parameter is extracted automatically. Do not use `suite_entity_num` / display IDs like `t104121`. || `--file <path>` | Yes | Local file path to upload. Must be a relative path within the current working directory; absolute paths and paths escaping the cwd are rejected. Single file only, ≤ 50 MB. || `--resource-type <type>` | No | Owning resource type. Defaults to `task`. Use `task_delivery` when uploading to task agents. || `--user-id-type <type>` | No | User ID type for the request. Defaults to `open_id`. |