
Wecomcli Manage Smartsheet Data
CRUD rows in WeCom (企业微信) Smart Sheet documents via wecom-cli when your agent must read, append, update, or delete operational tables.
Overview
Wecomcli-manage-smartsheet-data is an agent skill for the Build phase that reads and writes WeCom Smart Sheet records through the wecom-cli doc tools.
Install
npx skills add https://github.com/wecomteam/wecom-cli --skill wecomcli-manage-smartsheet-dataWhat is this skill?
- Full record lifecycle: smartsheet_get_records, add, update, delete via wecom-cli doc category
- Locate documents by docid or full Smartsheet URL interchangeably
- Pre-add guidance: smartsheet_get_fields for field_type and Option id matching
- Batch add up to ~500 rows per call with typed cell value payloads
- Standard errcode/errmsg JSON with one automatic retry on failure
- Batch add guidance: up to 500 rows per smartsheet_add_records call
- 1 automatic retry on non-zero errcode
Adoption & trust: 2.4k installs on skills.sh; 2.2k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent needs to sync tasks or ops data into a WeCom Smart Sheet but raw API shapes and Option field ids are easy to get wrong.
Who is it for?
Indie builders automating WeCom-based team trackers who already use wecom-cli and want repeatable CRUD prompts for agents.
Skip if: Teams not on WeCom or builders who need generic Google Sheets/Airtable integrations without installing wecom-cli.
When should I use this skill?
User needs to query, add, update, or delete Smart Sheet rows; read/write table data; locate docs via docid or WeCom Smartsheet URL.
What do I get? / Deliverables
Your agent runs documented smartsheet_get/add/update/delete commands and returns structured JSON rows with validated cell value formats.
- JSON record sets from get operations
- Inserted/updated row confirmations with errcode 0
- User-visible error messages after failed retries
Recommended Skills
Journey fit
Build/integrations is the right shelf for a CLI-backed enterprise messaging/table integration installed while wiring agent tooling to live team data. Integrations subphase matches docid/URL定位, smartsheet_* tools, and cell-value format contracts for Option fields.
How it compares
CLI integration skill for WeCom Smart Sheets—not a hosted MCP server or REST SDK wrapper in-repo.
Common Questions / FAQ
Who is wecomcli-manage-smartsheet-data for?
Solo developers and small China-based teams using Claude Code or similar agents to maintain 企业微信智能表格 data via the official wecom-cli binary.
When should I use wecomcli-manage-smartsheet-data?
During Build integrations when you need to query an ops sheet, bulk-insert up to 500 rows, update task status cells, or delete stale records from a docid or shared URL.
Is wecomcli-manage-smartsheet-data safe to install?
Review the Security Audits panel on this Prism page; the skill executes shell commands with network access to WeCom APIs—scope credentials and audit wecom-cli installs separately.
SKILL.md
READMESKILL.md - Wecomcli Manage Smartsheet Data
# 企业微信智能表格数据管理 > `wecom-cli` 是企业微信提供的命令行程序,所有操作通过执行 `wecom-cli` 命令完成。 管理智能表格中的记录(行数据)。所有接口支持通过 `docid` 或 `url` 二选一定位文档。 ## CLI 调用方式 通过 `wecom-cli` 调用,品类为 `doc`: ```bash wecom-cli doc <tool_name> '<json_params>' ``` ## 返回格式说明 所有接口返回 JSON 对象,包含以下公共字段: | 字段 | 类型 | 说明 | |------|------|------| | `errcode` | integer | 返回码,`0` 表示成功,非 `0` 表示失败 | | `errmsg` | string | 错误信息,成功时为 `"ok"` | 当 `errcode` 不为 `0` 时,说明接口调用失败,可重试 1 次;若仍失败,将 `errcode` 和 `errmsg` 展示给用户。 ### smartsheet_get_records 查询子表全部记录。 - 通过 sheetid: ```bash wecom-cli doc smartsheet_get_records '{"docid": "DOCID", "sheet_id": "SHEETID"}' ``` - 或通过 URL: ```bash wecom-cli doc smartsheet_get_records '{"url": "https://doc.weixin.qq.com/smartsheet/xxx", "sheet_id": "SHEETID"}' ``` 参见 [API 详情](references/api-get-records.md)。 ### smartsheet_add_records 添加一行或多行记录,单次建议 500 行内。 **调用前**必须先了解目标表的字段类型(通过 `smartsheet_get_fields`),重点关注 `field_type`。对于单选/多选(Option)字段,需注意匹配已有选项的 `id`。 ```bash wecom-cli doc smartsheet_add_records '{"docid": "DOCID", "sheet_id": "SHEETID", "records": [{"values": {"任务名称": [{"type": "text", "text": "完成需求文档"}], "优先级": [{"text": "高"}]}}]}' ``` 各字段类型的值格式参见 [单元格值格式参考](references/cell-value-formats.md)。 ### smartsheet_update_records 更新一行或多行记录,单次建议在 500 行内。需提供 record_id(通过 `smartsheet_get_records` 获取)。支持通过 `key_type` 指定 values 的 key 使用字段标题或字段 ID: - `CELL_VALUE_KEY_TYPE_FIELD_TITLE`:key 为字段标题 - `CELL_VALUE_KEY_TYPE_FIELD_ID`:key 为字段 ID ```bash wecom-cli doc smartsheet_update_records '{"docid": "DOCID", "sheet_id": "SHEETID", "key_type": "CELL_VALUE_KEY_TYPE_FIELD_TITLE", "records": [{"record_id": "RECORDID", "values": {"任务名称": [{"type": "text", "text": "更新后的内容"}]}}]}' ``` **注意**:创建时间、最后编辑时间、创建人、最后编辑人字段不可更新。 ### smartsheet_delete_records 删除一行或多行记录,单次必须在 500 行内。**操作不可逆**。record_id 通过 `smartsheet_get_records` 获取。 ```bash wecom-cli doc smartsheet_delete_records '{"docid": "DOCID", "sheet_id": "SHEETID", "record_ids": ["RECORDID1", "RECORDID2"]}' ``` ## 典型工作流 1. **读取数据** → ```bash wecom-cli doc smartsheet_get_records '{"docid":"DOCID","sheet_id":"SHEETID"}' ``` 2. **写入数据** → 先 `smartsheet_get_fields` 了解列类型 → 若涉及成员(USER)字段,先通过 `wecomcli-lookup-contact` 的 `get_userlist` 查找人员 userid → `smartsheet_add_records` 写入 3. **更新数据** → 先 `smartsheet_get_records` 获取 record_id → 若涉及成员(USER)字段,先通过 `wecomcli-lookup-contact` 的 `get_userlist` 查找人员 userid → `smartsheet_update_records` 更新 4. **删除数据** → 先 `smartsheet_get_records` 确认 record_id → `smartsheet_delete_records` 删除 > **注意**:成员(USER)类型字段需要填写 `user_id`,不能直接使用姓名。必须先通过 `wecomcli-lookup-contact` 技能的 `get_userlist` 接口按姓名查找到对应的 `userid` 后再使用。 # smartsheet_get_records API 查询智能表格中指定子表的记录信息。只支持获取全部记录。支持通过 docid 或文档 URL 定位文档,二者传入其一即可。 ## 技能定义 ```json { "name": "smartsheet_get_records", "description": "查询智能表格中指定子表的记录信息。只支持获取全部记录。支持通过 docid 或文档 URL 定位文档,二者传入其一即可。", "inputSchema": { "properties": { "docid": { "description": "文档的 docid,与 url 二选一传入", "title": "Docid", "type": "string" }, "url": { "description": "文档的访问链接,与 docid 二选一传入", "title": "URL", "type": "string" }, "sheet_id": { "description": "子表的 sheet_id,用于指定要查询的智能表格中的哪个子表", "title": "Sheet Id", "type": "string" } }, "oneOf": [ { "required": ["docid", "sheet_id"] }, { "required": ["url", "sheet_id"] } ], "title": "smartsheet_get_recordsArguments", "type": "object" } } ``` ## 参数说明 | 参数 | 类型 | 必填 | 说明 | |---|---|---|---| | docid | string | 与 url 二选一 | 文档的 docid | | url | string |