🧪 EXPERIMENTAL · Experimental / Preview — multi mode currently does not meet the stable standard. All dingtalk-* skills have passed the dispatch verifier, but interfaces, naming, and cross-skill references may be adjusted later; for production / shared environments, prefer mono mode (
dws skill setup --mode mono). For issues, please file an issue.
PREREQUISITE: Read the
dws-sharedskill first for auth, global flags, product routing, URL preflight, error codes, and safety rules. Thedwsbinary must be on PATH.
⚠️ Command availability is subject to the current dws binary. Service discovery has been taken offline; this document is released along with the built-in skill; if
dws <cmd> --helpdoes not exist, it means the current version does not expose that command. If the command exists but the call fails, confirm the static endpoint catalog and backend tool registration according to the endpoint or tool hints in the error. Before actually calling, you can usedws <cmd> --helpor--dry-runto verify.
Command reference:sheet.md; URL recognition and type probing:url-patterns.md。
URL pre-check (required reading when an alidocs URL is present)
When the input contains alidocs.dingtalk.com URL, multiple path formats exist under that domain:/i/p/...(share short link),/i/nodes/...(node link, type needs probing),/spreadsheetv2/...(spreadsheet direct link, routes directly to sheet)、/document/edit|preview?dentryKey=...(document link, routes to dingtalk-doc), etc.You must first read url-patterns.md the "alidocs URL routing decision" in, and identify the URL type according to the rules; only when it is confirmed to be an online spreadsheet (/spreadsheetv2/... or i/nodes/ and probe yields contentType=ALIDOC + extension=axls) should you continue with this skill's commands.
Shortcuts (preferred when there is no dedicated script/recipe)
The following shortcuts come from a public catalog independent of the Runtime Schema. First route by this skill's intent table, scripts, and recipes: when a dedicated script/recipe that precisely covers the scenario exists, execute according to it; otherwise, when the user's intent matches, shortcuts take precedence over handwritten atomic commands. Use dws shortcut list --service sheet --format json to read parameters, constraints, risks, and examples, and use dws sheet <shortcut> --help to check the current Cobra flags; do not call + on the dws schema。
| Shortcut | Risk | Applicable scenarios |
|---|---|---|
dws sheet +list-sheets |
read | Get the list of all worksheets in a spreadsheet document |
dws sheet +read |
read | Read structured cell data for a specified range in a worksheet |
Intent table
| User says | Command |
|---|---|
| "Create a spreadsheet" | dws sheet create --name "<标题>" |
| "Import a local Excel as an online spreadsheet" | dws sheet import create --file <xlsx或xls> --folder-token <ID> or --workspace <ID> |
| "Create a new worksheet" | dws sheet new --node <nodeId或URL> --name "<sheet名>" |
| "Read a cell" | dws sheet range read --node <nodeId或URL> --sheet-id <sheetId> --range A1:B2 |
| "Write a cell" | dws sheet range update --node <nodeId或URL> --sheet-id <sheetId> --range A1:B2 --values '[[..]]' |
| "Structured read / DataFrame read" | dws sheet table-get --node <nodeId或URL> [--sheet-id <sheetId>] |
| "Structured write / DataFrame write" | dws sheet table-put --node <nodeId或URL> --sheets '<JSON>' |
| "Create a pivot table / data pivot" | dws sheet pivot-table create --node <nodeId或URL> --source "'Sheet1'!A1:D100" --properties '<JSON>' |
| "View a pivot table" | dws sheet pivot-table list --node <nodeId或URL> --sheet-id <sheetId> |
| "Show / hide gridlines" | `dws sheet show-gridline |
| "Append a row" | dws sheet append --node <nodeId或URL> --sheet-id <sheetId> --values '[[..]]' |
| "Find / replace" | dws sheet find --node <nodeId或URL> --sheet-id <sheetId> --find "<关键词>" / dws sheet replace --node <nodeId或URL> --sheet-id <sheetId> --find "<旧值>" --replacement "<新值>" |
| "Insert an image into a cell" | dws sheet write-image --node <nodeId或URL> --sheet-id <sheetId> --range A1:A1 --file <本地图片路径>(the CLI automatically uploads the local image and writes it into the cell; there are no --resource-id/--resource-url flags) |
URL and ID prefixing
- When the user directly pastes a
alidocs.dingtalk.comURL, first rundws doc info --node "<URL>" --format jsondetection; only ifcontentType=ALIDOCandextension=axlsthen continue withsheet。 spreadsheetv2For links, do not truncate short path segments; the complete URL must be passed as-is to--node。- Write-type commands must first use
dws sheet list --node <nodeId或URL> --format jsonto obtain the realsheetId; do not guessSheet1、sheet1、0。 - All sheet subcommands use the
--nodeparameter; do not write--node-id、--file-idor pass the JSON field nameidas a node value.
High-frequency hard constraints for evaluation
sheet createAfter that, the realnodeIdor document URL must be extracted from the returned result, and subsequentlyrange update/readmust be passed as-is to--node; if the return contains bothnodeIdandurl, prefernodeId。- Before writing to a region, first
sheet list --node <nodeId> --format jsonto obtain the realsheetId; immediately after writing,range readthe same region to verify. range updateThe--valuesmust be a two-dimensional JSON, with the number of rows and columns exactly matching--range; for batch styles userange batch-set-style --batch <json文件>。- The same parameter error may be corrected at most 2 times; if it persists
nodeId 格式不合法, go back todoc info --node <URL>orsheet createto retrieve the ID again, and do not retry meaninglessly.
Cross-product collaboration
- Multi-dimensional table / field type → switch to
dingtalk-aitable - Write table data into a document → switch to
dingtalk-doc