Pinvou/pinvou-agent / pinvou3-app/src-tauri/resources/common/bundle/dingtalk-skills/dws
dws
Unverified【何时用:仅当用户明确指向钉钉/DingTalk(钉钉文档、钉钉日程等)时使用;泛指做文档/表格/待办/审批默认走本地工具,不要误用钉钉】用 dws CLI 管理钉钉:AI表格/AI搜问(找人首选)/目标管理(Agoal)/组织大脑/日历/通讯录/群聊与机器人消息/待办/审批/智能合同/考勤/日志(日报周报)/DING消息/钉钉文档/云盘/Markdown文件/HTML文件/AI听记/邮箱/在线电子表格(axls)/知识库/白板/开放平台文档/个人IM与OA事件订阅。用户要求操作上述钉钉产品时使用。
references/products/doc/doc-export.md
View on GitHub# doc export(在线文档导出为 docx / markdown / pdf)
> **前置条件(MUST READ):** 执行本命令前,必须先用 `read` 读取以下文件:
> 1. [`../doc.md`](../doc.md) — 命令路由 + 场景索引 + 意图判断 + 工作流
> **路由前置判断**:用户说「下载/导出」时**必须**先用 [`./doc-info.md`](./doc-info.md) `info --node <ID> --format json` 查 `contentType`:
> - `contentType` 为 `ALIDOC`(在线文档)→ **必须用 `export`**,禁止用 `download`
> - `contentType` 为 `DOCUMENT`/`IMAGE`/`VIDEO` 等(已有文件)→ 用 `dws drive download`(详见 [`../drive.md`](../drive.md))
>
> `drive download` 只能下载**已有文件**(原样下载),`export` 是将**在线文档格式转换**后导出为 docx,两者完全不同。
---
## doc export(一体化命令)
```
Usage:
dws doc export [flags]
Example:
dws doc export --node "https://alidocs.dingtalk.com/i/nodes/xxx" --output ./exported.docx
dws doc export --node <DOC_ID> --output ~/downloads/
dws doc export --node <DOC_ID> --export-format markdown --output ./exported.md
Flags:
--node string 要导出的文档标识,支持文档 URL 或 dentryUuid (必填)
--output string 本地保存路径,文件路径或目录 (必填)
--export-format string 导出格式: docx (默认) / markdown (或 md) / pdf
```
CLI 内部自动完成:提交导出任务 → 渐进式退避轮询(最多约 5 分钟)→ 成功后自动下载文件。
**只需一条命令,无需手动轮询。**`--output` 传入目录时,根据 `--export-format` 自动追加扩展名。
---
## doc export get(手动兜底查询任务)
```
Usage:
dws doc export get [flags]
Example:
dws doc export get --job-id <JOB_ID>
Flags:
--job-id string 导出任务 ID (必填)
```
仅在 `dws doc export` 超时或中断后,用于手动查询任务状态。通常不需要调用。
## 关键说明
- `export` 是一体化命令,一条命令自动完成提交→轮询→下载,**无需手动编排轮询**。CLI 内部使用渐进式退避轮询(最多约 5 分钟)。
- `export` 超时或中断后,CLI 会输出 `jobId`,可用 `dws doc export get --job-id <jobId>` 手动查询任务状态。
- `export` 仅作用于钉钉在线文档(alidocs,`contentType=ALIDOC`),格式由 `--export-format` 决定:`docx`(默认)/ `markdown` (`.md`) / `pdf`;在线表格(axls)导出走 [`dws sheet export`](../sheet.md)。
- `--output` 既可以是文件完整路径,也可以是目录(CLI 自动按文档名生成扩展名,按 `--export-format` 为 `.docx`/`.md`/`.pdf`)。
## 上下文传递
| 从返回中提取 | 用于 |
|-------------|------|
| `localPath` | 用户可访问的本地文件路径 |
| 中断时返回的 `jobId` | `export get` 的 `--job-id` |
## 常用模板
```bash
# 一体化导出(最常用)
dws doc export --node <DOC_ID> --output ./exported.docx
# 输出到目录(自动按文档名命名)
dws doc export --node <DOC_ID> --output ~/downloads/
# alidocs URL 直传
dws doc export --node "https://alidocs.dingtalk.com/i/nodes/<DOC_UUID>" --output ./exported.docx
# 兜底:超时或中断后手动查任务
dws doc export get --job-id <JOB_ID> --format json
```
## 参考
- [`../doc.md` §意图判断](../doc.md#意图判断)(如何路由到本命令)
- [`./doc-info.md`](./doc-info.md)(前置:判断 contentType=ALIDOC 才走 export)
- [`../drive.md`](../drive.md)(非 ALIDOC 文件用 `dws drive download`)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |