Attachment upload sends local file contents to Lark
Source references: 4The command reads a relative-path file from the working directory and uploads it to a task or task agent. Path restrictions prevent directory escape but do not determine whether the file contains credentials, customer data, or other sensitive material.
If the wrong file, task GUID, or task agent is selected, people with access to that Lark resource may see the file contents.
This feature reads one local file from the current working directory and uploads it to a Lark task or task agent. Relative-path, directory, and 50 MB restrictions reduce arbitrary-file access, and the workflow requires confirming the target and path; however, it does not require checking the file for credentials or sensitive data. If the wrong file is selected, its contents leave the device and may become visible to task participants. The user can require a pre-upload display of the filename, destination, and sensitivity check.
|-----------|----------|-------------|| `--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`. |Show 3 other places
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`. |