PluginBench
Skill
Pass
Audit score 90

wecomcli-manage-smartsheet-schema

wecomteam/wecom-cli

Manage WeChat Work smartsheet structure: add, update, delete sheets and fields via CLI.

What is wecomcli-manage-smartsheet-schema?

Manages the schema of WeChat Work smartsheets, including sub-sheets and field/column operations. Use this when you need to query, create, modify, or delete sheets and their fields within a smartsheet document.

  • Query all sub-sheets in a document with metadata (sheet_id, title, type)
  • Add, update, and delete sub-sheets within a smartsheet document
  • Query all fields/columns in a sub-sheet with type information
  • Add, update (rename), and delete fields/columns in a sub-sheet
  • Locate documents by docid or document URL

How to install wecomcli-manage-smartsheet-schema

npx skills add https://github.com/wecomteam/wecom-cli --skill wecomcli-manage-smartsheet-schema
Prerequisites
  • wecom-cli installed and configured
  • Valid docid or smartsheet document URL
Claude Code
Cursor
Windsurf
Cline

How to use wecomcli-manage-smartsheet-schema

  1. 1.Run `wecom-cli doc smartsheet_get_sheet '{"docid": "DOCID"}'` to list all sub-sheets
  2. 2.Run `wecom-cli doc smartsheet_get_fields '{"docid": "DOCID", "sheet_id": "SHEETID"}'` to view fields in a sheet
  3. 3.Use `smartsheet_add_sheet` to create new sub-sheets with a title
  4. 4.Use `smartsheet_add_fields` to add columns, specifying field_title and field_type
  5. 5.Use `smartsheet_update_fields` to rename fields (pass original field_type unchanged)
  6. 6.Use `smartsheet_delete_sheet` or `smartsheet_delete_fields` to remove sheets or columns (irreversible)

Use cases

Good for
  • Retrieve the complete structure of an existing smartsheet to understand its layout
  • Create new sub-sheets and define their field schemas from scratch
  • Rename fields or columns to match updated business requirements
  • Remove obsolete sheets or columns from a smartsheet document
  • Programmatically set up multi-sheet smartsheet templates with specific field types
Who it's for
  • WeChat Work administrators managing smartsheet documents
  • Developers automating smartsheet schema setup and maintenance
  • Teams building smartsheet templates with specific structures

wecomcli-manage-smartsheet-schema FAQ

Can I change a field's type after creation?

No. The update operation only allows renaming fields. To change type, you must delete and recreate the field.

What is the maximum number of fields per sub-sheet?

Each sub-sheet supports a maximum of 150 fields.

How do I identify a sheet or field?

Use `smartsheet_get_sheet` to get sheet_id values and `smartsheet_get_fields` to get field_id values.

Are delete operations reversible?

No. Deleting sheets or fields is permanent and cannot be undone.

Can I specify the document by URL instead of docid?

Yes. All operations support either docid or document URL as the document identifier.

Full instructions (SKILL.md)

Source of truth, from wecomteam/wecom-cli.


name: wecomcli-manage-smartsheet-schema description: 企业微信智能表格结构管理技能。提供子表(Sheet)和字段(Field/列)的增删改查能力。适用场景:(1) 查询智能表格的子表列表 (2) 添加、更新、删除子表 (3) 查询子表的字段/列信息 (4) 添加、更新、删除字段/列。当用户需要管理智能表格的表结构、列定义、子表配置时触发此 Skill。支持通过 docid 或文档 URL 定位文档。 metadata: requires: bins: ["wecom-cli"] cliHelp: "wecom-cli doc --help"

企业微信智能表格结构管理

wecom-cli 是企业微信提供的命令行程序,所有操作通过执行 wecom-cli 命令完成。

管理智能表格的子表和字段(列)结构。所有接口支持通过 docidurl 二选一定位文档。

调用方式

通过 wecom-cli 调用,品类为 doc

wecom-cli doc <tool_name> '<json_params>'

返回格式说明

所有接口返回 JSON 对象,包含以下公共字段:

字段类型说明
errcodeinteger返回码,0 表示成功,非 0 表示失败
errmsgstring错误信息,成功时为 "ok"

errcode 不为 0 时,说明接口调用失败,可重试 1 次;若仍失败,将 errcodeerrmsg 展示给用户。

子表管理

smartsheet_get_sheet

查询文档中所有子表信息,返回 sheet_id、title、类型等。

wecom-cli doc smartsheet_get_sheet '{"docid": "DOCID"}'

smartsheet_add_sheet

添加空子表。新子表不含视图、记录和字段,需通过其他接口补充。

wecom-cli doc smartsheet_add_sheet '{"docid": "DOCID", "properties": {"title": "新子表"}}'

注意:新建智能表格文档默认已含一个子表,仅需多个子表时调用。

smartsheet_update_sheet

修改子表标题。需提供 sheet_id 和新 title。

wecom-cli doc smartsheet_update_sheet '{"docid": "DOCID", "properties":{"sheet_id":"SHEET_ID", "title":"新子表"}}'

smartsheet_delete_sheet

永久删除子表,操作不可逆

wecom-cli doc smartsheet_delete_sheet '{"docid": "DOCID", "sheet_id": "SHEETID"}'

字段管理

smartsheet_get_fields

查询子表的所有字段信息,返回 field_id、field_title、field_type。

wecom-cli doc smartsheet_get_fields '{"docid": "DOCID", "sheet_id": "SHEETID"}'

smartsheet_add_fields

向子表添加一个或多个字段。单个子表最多 150 个字段。

wecom-cli doc smartsheet_add_fields '{"docid": "DOCID", "sheet_id": "SHEETID", "fields": [{"field_title": "任务名称", "field_type": "FIELD_TYPE_TEXT"}]}'

支持的字段类型参见 字段类型参考

smartsheet_update_fields

更新字段标题。只能改名,不能改类型(field_type 必须传原始类型)。field_title 不能更新为原值。

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

删除一列或多列字段,操作不可逆。field_id 可通过 smartsheet_get_fields 获取。

wecom-cli doc smartsheet_delete_fields '{"docid": "DOCID", "sheet_id": "SHEETID", "field_ids": ["FIELDID"]}'

典型工作流

  1. 了解表结构
wecom-cli doc smartsheet_get_sheet '{"docid": "DOCID"}'

wecom-cli doc smartsheet_get_fields '{"docid": "DOCID", "sheet_id": "SHEETID"}'
  1. 创建表结构smartsheet_add_sheet 添加子表 → smartsheet_add_fields 定义列
  2. 修改表结构smartsheet_update_fields 改列名 / smartsheet_delete_fields 删列