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
Added on

NPX Install

npx skill4agent add wecomteam/wecom-cli wecomcli-manage-smartsheet-schema

Tags

Translated version includes tags in frontmatter

SKILL.md Content (Chinese)

View Translation Comparison →

WeCom Smart Table Structure Management

wecom-cli
is a command-line program provided by WeCom, all operations are completed by executing
wecom-cli
commands.
Manage the structure of sub-sheets and fields (columns) of smart tables. All interfaces support locating documents by either
docid
or
url
.

Invocation Method

Invoke via
wecom-cli
, the category is
doc
:
bash
wecom-cli doc <tool_name> '<json_params>'

Return Format Description

All interfaces return JSON objects, containing the following common fields:
FieldTypeDescription
errcode
integerReturn code,
0
indicates success, non-
0
indicates failure
errmsg
stringError message, it is
"ok"
when the request succeeds
When
errcode
is not
0
, it means the interface call failed, you can retry once; if it still fails, display
errcode
and
errmsg
to the user.

Sub-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_fields
.
bash
wecom-cli doc smartsheet_delete_fields '{"docid": "DOCID", "sheet_id": "SHEETID", "field_ids": ["FIELDID"]}'

Typical Workflow

  1. Understand table structure
bash
wecom-cli doc smartsheet_get_sheet
bash
wecom-cli doc smartsheet_get_fields
  1. Create table structure → Add sub-sheet with
    smartsheet_add_sheet
    → Define columns with
    smartsheet_add_fields
  2. Modify table structure → Rename columns with
    smartsheet_update_fields
    / Delete columns with
    smartsheet_delete_fields