wecomcli-manage-smartsheet-schema
Original:🇨🇳 Chinese
Translated
WeCom Smart Table Structure Management Skill. It provides CRUD capabilities for Sheets and fields (columns). Applicable scenarios: (1) Query the sub-sheet list of the smart table (2) Add, update, delete sub-sheets (3) Query field/column information of sub-sheets (4) Add, update, delete fields/columns. This Skill is triggered when users need to manage the table structure, column definitions, and sub-sheet configurations of the smart table. Supports locating documents via docid or document URL.
122installs
Sourcewecomteam/wecom-cli
Added on
NPX Install
npx skill4agent add wecomteam/wecom-cli wecomcli-manage-smartsheet-schemaTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →WeCom Smart Table Structure Management
is a command-line program provided by WeCom, all operations are completed by executingwecom-clicommands.wecom-cli
Manage the structure of sub-sheets and fields (columns) of smart tables. All interfaces support locating documents by either or .
docidurlInvocation Method
Invoke via , the category is :
wecom-clidocbash
wecom-cli doc <tool_name> '<json_params>'Return Format Description
All interfaces return JSON objects, containing the following common fields:
| Field | Type | Description |
|---|---|---|
| integer | Return code, |
| string | Error message, it is |
When is not , it means the interface call failed, you can retry once; if it still fails, display and to the user.
errcode0errcodeerrmsgSub-sheet Management
smartsheet_get_sheet
Query all sub-sheet information in the document, return sheet_id, title, type, etc.
bash
wecom-cli doc smartsheet_get_sheet '{"docid": "DOCID"}'smartsheet_add_sheet
Add an empty sub-sheet. The new sub-sheet does not contain views, records and fields, which need to be supplemented through other interfaces.
bash
wecom-cli doc smartsheet_add_sheet '{"docid": "DOCID", "properties": {"title": "新子表"}}'Note: A newly created smart table document contains one sub-sheet by default, call this interface only when you need multiple sub-sheets.
smartsheet_update_sheet
Modify the sub-sheet title. You need to provide sheet_id and the new title.
bash
wecom-cli doc smartsheet_update_sheet '{"docid": "DOCID", "sheet_id": "SHEETID", "title": "新标题"}'smartsheet_delete_sheet
Permanently delete the sub-sheet, operation is irreversible.
bash
wecom-cli doc smartsheet_delete_sheet '{"docid": "DOCID", "sheet_id": "SHEETID"}'Field Management
smartsheet_get_fields
Query all field information of the sub-sheet, return field_id, field_title, field_type.
bash
wecom-cli doc smartsheet_get_fields '{"docid": "DOCID", "sheet_id": "SHEETID"}'smartsheet_add_fields
Add one or more fields to the sub-sheet. A single sub-sheet supports up to 150 fields.
bash
wecom-cli doc smartsheet_add_fields '{"docid": "DOCID", "sheet_id": "SHEETID", "fields": [{"field_title": "任务名称", "field_type": "FIELD_TYPE_TEXT"}]}'For supported field types, see Field Type Reference.
smartsheet_update_fields
Update the field title. Only renaming is allowed, type cannot be modified (the original field_type must be passed). The field_title cannot be updated to the original value.
bash
wecom-cli doc smartsheet_update_fields '{"docid": "DOCID", "sheet_id": "SHEETID", "fields": [{"field_id": "FIELDID", "field_title": "新标题", "field_type": "FIELD_TYPE_TEXT"}]}'smartsheet_delete_fields
Delete one or more columns of fields, operation is irreversible. The field_id can be obtained via .
smartsheet_get_fieldsbash
wecom-cli doc smartsheet_delete_fields '{"docid": "DOCID", "sheet_id": "SHEETID", "field_ids": ["FIELDID"]}'Typical Workflow
- Understand table structure →
bash
wecom-cli doc smartsheet_get_sheet→
bash
wecom-cli doc smartsheet_get_fields- Create table structure → Add sub-sheet with → Define columns with
smartsheet_add_sheetsmartsheet_add_fields - Modify table structure → Rename columns with / Delete columns with
smartsheet_update_fieldssmartsheet_delete_fields