SuperAPI AI Directory

meegle

Office & productivity

View repository

Updated 10-15 22:33

About this skill

Feishu Project (Meego/Meegle) Operation Guide

This skill operates Feishu Project data through the Meegle CLI. The output language follows the user's input language, defaulting to Chinese.

For invocation examples of each command, see references/api-examples.md。 Authorization Process(must be executed before all business commands): see references/auth-guard.md CLI Usage Guide(command structure, parameter passing, command discovery): see references/cli-guide.md


Project Space Domain

project search

Search space information, convert a space name to a project_key or verify whether a space exists; when --project-key is omitted, returns the list of spaces recently visited by the current user (ordered from most recent to least recent by visit time).

Parameter Type Required Description
--project-key string No Space projectKey, simpleName, or space name; leave blank to query spaces accessible to the current user
--page-num number No Page number for pagination, 50 items per page, starting from 1

WorkItem Domain

For the parameter table of metadata query commands (workitem meta-types / workitem meta-fields / workitem meta-roles / workitem meta-create-fields), see references/workitem.md。

workitem create

Create a work item instance.Be sure to first use workitem meta-fields to get field information, andworkitem meta-roles to get role information. The template ID is required.

Parameter Type Required Description
--work-item-type string Yes Work item type
--project-key string No Space identifier
--fields array No List of field values, each item containing field_key and field_value

workitem get

Query a work item overview by ID/name. When fields is not passed, returns fixed basic fields plus a set of default system fields:group_type(group chat method),description、current_status_operator、watchers(also appears when value is null); for other fields, first obtain the key through workitem meta-fields and then pass it in fields.

Parameter Type Required Description
--work-item-id string No Work item ID (choose one of the two with --name )
--name string No Query work item by name (choose one of the two with --work-item-id )
--project-key string No Space key
--fields array No The field_key or field_name to query; when ["_all"] is passed, returns all fields paginated by logical field; when ["group_type"] is passed, only retrieves the group chat method
--page-size number No Only effective when fields=["_all"] ; number of fields per page, default 100, maximum 200.Meegle CLI serialization constraint:--page-size N will be serialized as a string, triggering the backend need I64 type, but got: STRING; must go through --params '{"page_size":N}' to pass it out as a number
--page-token string No Only effective when fields=["_all"] ; pagination token, not passed on the first request, on the next page pass the next_page_tokenfrom the previous page's response (the token looks like a field key, for example "business"); as above, must go through --params '{"page_token":"..."}'

Logical field aggregation (important mental model): The server aggregates group_id / chat_group such "group-creation"-related physical fieldsmergesinto a single logical field group_type. Reads/updates uniformly go through group_type,Do not separately read group_id or chat_group。

⚠️ Read-write protocol asymmetry: In the read response structure,the discriminant key is value(not type); when updating,the discriminant key is type—it is forbidden to write back directly based on the structure read.

Shape of the read response (workitem_fields[].value field):

  • auto → {value: "auto", label: "自动拉群", group_id: "oc_xxx"}(auto group creation includes group_id; oc_id may change when the status switches)
  • bind → {value: "bind", label: "绑定现有群", group_id: "oc_xxx"}
  • disabled → {value: "disabled", label: "不拉群"}(no group_id)

Write protocol (field_value JSON inside):{"type": "auto" | "bind" | "disabled", "group_id": "oc_xxx"}

workitem +batch-get

Batch query work items (Meegle CLI client fan-out: concurrent calls to workitem get). Single run ≤ 200 IDs, 3 concurrent, returns {results, errors, summary}; when the number of IDs is large, use --format ndjson for streaming output.

Parameter Type Required Description
--work-item-ids array Choose one of the two List of work item IDs (comma-separated or passed multiple times)
--ids-file string Choose one of the two Read IDs from a file (one per line,# leading comment)
--fields array No List of field_key to query
--project-key string No Space key

workitem update

Modify the field values or roles of a specified instance. Node field updates must use workflow update-node。

Parameter Type Required Description
--work-item-id string Yes Work item ID or name
--project-key string No Space key
--fields array No List of fields to update, each containing field_key and field_value
--role-operate array No Role operations, each containing op(add/remove), role_key, user_keys

Role updates: Roles cannot be updated via fields; you must use role_operate. role_key is obtained via workitem meta-roles , and user_keys via user search .

Updating the group-creation method (group_type logical field): To modify/read the group-creation method, uniformly go through group_type, and do not separately operate group_id / chat_group. Write protocol field_value looks like:{"type": "auto" | "bind" | "disabled", "group_id": "oc_xxx"}(note that writes use type as the discriminant key,which is asymmetric with the value returned by reads). Validation rules (actual server error text):bind without group_id or with an empty string/only spaces → group_id is required when group_type=bind;auto/disabled while also carrying group_id → group_type conflicts with group_id: type=<auto|disabled>. For detailed examples, see references/sop-update-workitem.md。

workitem query

Use MQL to query work item data. The syntax is split by topic across 6 files: Basics and hard rules references/mql-basics.md, Operators and array functions references/mql-operators.md, Time and status references/mql-time-status.md, People and roles references/mql-people-roles.md, Nodes and associations references/mql-nodes-relations.md, Full-sentence examples and keyword mapping references/mql-examples.md. Before writing MQL, read at least basics and operators.

Parameter Type Required Description
--project-key string Yes Space identifier (supports name, simpleName, projectKey)
--mql string Required for first query MQL query statement (full SQL). Returns at most 50 records per request;LIMIT n used only for truncation (n ≤ 50), not for pagination
--session-id string Required for pagination Used for pagination. Taken from the first query response body's session_id; when paginating, pass only --project-key + --session-id + --group-pagination-list, do not pass --mql, otherwise it is treated as a new query and re-executed, and pagination parameters are ignored
--group-pagination-list array Required for pagination Pagination parameter, used together with --session-id , not passed in the first query. 50 records per page, total pages = ceil(list[0].count / 50); currently only one set of [{"group_id":"<分组ID>","page_num":N}]

Pagination to fetch all records(when all results are needed, this path must be used, do not use LIMIT offset, n for pagination):

  1. The first query passes only --project-key + --mql, returning page 1 (at most 50 records). From the response body take session_id、list[0].count、list[0].group_infos[].group_id; for queries without grouping, group_id is "1"。
  2. Afterwards each page passes --project-key + --session-id + --group-pagination-list '[{"group_id":"<分组ID>","page_num":N}]', does not pass --mql。 page_num from 2 to ceil(count/50); page 1 is already returned by the first query.
  3. In the pagination response list / session_id is null, the total can only be obtained from page 1;session_id passed together with a non-empty MQL will re-execute the MQL and return to page 1.

Key points:

  • First use workitem meta-fields / workitem meta-roles to get field and role configuration; if not found, report an error directly and do not continue
  • After SELECT, attributes should not be too many,prefer using field key(such as name、priority、status); at most 50 records per request, when all records are needed follow the "Pagination to fetch all records" above using --session-id + --group-pagination-list to fetch page by page

workitem list-op-records

View work item operation records.

Parameter Type Required Description
--project-key string Yes Space key
--work-item-id string Yes Work item ID

Attachment field domain

Attachments must complete "object storage upload → target field binding → read back the same field for verification"; a successful upload does not mean the attachment field has been written. When work item attachments are involved, you must first disambiguate in real time the file and multi-file fields under the current type, and follow references/attachment.md the complete protocol to execute. Meegle CLI provides attachment +upload / attachment +download one-click encapsulation of object storage steps.

WorkFlow domain

Transition helper command (workflow list-state-transitions / workflow list-state-required / workflow meta-node-fields) parameter table see references/workflow.md。

workflow transition

Only used for node flow work items, operating nodes to complete transition or rollback.

Parameter Type Required Description
--work-item-id string Yes Work item ID
--action string No confirm (transition) / rollback (rollback)
--node-id string No Node ID
--rollback-reason string No Rollback reason, required when action=rollback
--project-key string No Space key

workflow transition-state

Only used for state flow work items, transitions the work item status. First use workflow list-state-transitions to get the transitionable statuses and transition_id.

Parameter Type Required Description
--work-item-id string Yes Work Item ID
--transition-id string No Status transition ID, from workflow list-state-transitions Get
--project-key string No Space key

workflow get-node

Get complete details of a specified node or all nodes in a work item.

Parameter Type Required Description
--work-item-id string Yes Work item ID or name
--node-id-list array No Node ID list; pass empty or _all to get all nodes
--field-key-list array No Node field key; pass empty or _all to get all fields
--need-sub-task boolean No Whether node sub-items (subtasks) are needed
--page-num number No At most 20 node details at a time, returned by page
--project-key string No Space key

workflow update-node

Modify nodes (schedule, assignee, custom fields, etc.). Schedule/differentiated schedule/assignee must not be modified at the same time; multiple calls are required.

Parameter Type Required Description
--work-item-id string Yes Work Item ID
--node-id string Yes Node ID (node_key)
--node-owners array No Array of node assignee userkeys; to clear, pass an empty array []
--node-schedule object No Node schedule, format {"estimate_start_date":ms,"estimate_end_date":ms,"owners":[userkey],"points":数字}; to clear, pass {}; if unchanged, do not pass
--schedules array No Differentiated schedule by person, with each item refined to an individual's schedule; to clear a person, estimate_start_date/estimate_end_date pass null
--fields array No Node custom fields, each item contains field_key and field_value(STRING protocol, see "Field Value Format")
--project-key string No Space key

MyWork workspace domain

mywork todo

Query the current user's work item list by action type. Query to-dos/completed items without MQL.

Parameter Type Required Description
--action string Yes todo/to-do/done/completed/overdue/this_week(to-do this week)
--page-num number Yes Page number, starting from 1, 50 items per page
--asset-key string No Workspace key (format Asset_xxx); pass only when an error requires selection

When complete results are needed, page continuously from page_num=1 until empty.


WorkHour domain

Work hour record query (workhour list-records) parameter table see references/misc.md。

workhour list-schedule

Get the schedule and workload details of specified personnel within a time range.

Parameter Type Required Description
--project-key string Yes Space key
--user-keys array Yes User identifier (name/email/userkey),at most 20 per time
--start-time string Yes Start time, format YYYY-MM-DD
--end-time string Yes End time, format YYYY-MM-DD,Maximum single span 3 months
--work-item-type-keys array No List of work item types, query all passed in _all

Invocation constraints: at most 20 people per call (split multiple people into parallel batches); single span ≤ 3 months (split by month if exceeded); summarize only after all batches are complete, and do not output conclusions before fully retrieving.


UserGroup personnel domain

Team-related commands (team list / team list-members) parameter table see references/misc.md。

user search

Batch query user basic information. Used to convert names/emails to userkey.

Parameter Type Required Description
--user-keys array Yes userKey, Email, or name, at most 20
--project-key string No Space key
--need-all-status boolean No Whether to return users of all statuses; default false, returns only active users

user me

View current user information. No parameters required.

In MQL,you can directly use the current_login_user() function without retrieving user information in advance. If you need to retrieve detailed information such as the current user's userkey/name, use user me。


View domain

View search and pinned view management (view search / view create-fixed / view update-fixed) parameter table see references/view.md。

view get

Get the list of work items under the view by view ID.

Parameter Type Required Description
--view-id string Yes View ID
--project-key string No Space key
--page-num number No Pagination page start
--fields array No Fields to query

Comment domain

Comment list query (comment list) parameter table see references/misc.md。

comment add

Add a comment. Supports rich text Markdown, syntax details see references/rich-text-editor-markdown-syntax.md(including extended syntax such as @mentions, alignment, link previews, font size/color, etc.).

Parameter Type Required Description
--work-item-id string Yes Work item ID
--content string Yes Comment content

Deliverable domain

Single-command small domain, parameter table see references/misc.md。

deliverable list

View deliverable details and their root work item / source work item. Can be filtered by a list of work item IDs.


Resource library

Resource library (resource template) management.resource create Currently corresponds to MCP create_resource_work_item, used to create resource instances; to view the resource library's field/role configuration use resource meta-fields. Detailed parameter table see references/misc.md。

resource create

Create a resource template (resource instance) under a work item type with the resource library enabled. Before creating, first call resource meta-fields to get the field/role configuration.

Semantic boundaries:

  • Create resource instance:work_item_type_key is a work item type with the resource library enabled;template_id is the process template ID/name under that type;fields / roles is the new resource instance's own fields and roles.
  • Create a normal work item from a resource instance: do not fill an existing resource instance ID into work_item_type_key or template_id. Must use the current resource create inspect/schema to confirm whether there is a source resource instance parameter; if the current schema does not expose this parameter, first explain to the user that the automation parameter cannot be confirmed, and do not guess.

WBS Plan Table

The plan table (WBS) has draft and published instance two data models. Common editing flow:wbs create-draft → multiple wbs edit-draft → wbs publish-draft; to discard changes use wbs reset-draft. For the detailed parameter table and the operation subtypes of wbs edit-draft , see references/wbs.md。

wbs list-draft-rows

Filter rows by conditions in the plan table draft. Common filter fields:wbs_name、wbs_parent_id、wbs_owner_in_charge、wbs_states_doing. For details, see references/wbs.md。

wbs list-instance-rows

Filter rows by conditions in the published online plan table instance. Parameters are the same as wbs list-draft-rows。

wbs edit-draft

Perform one atomic edit on the plan table draft. One call can pass only one operation_type, but within this operation, arrays such as items / uuids can carry single-row or batch edits; supports add / delete / restore / reorder / rename / change assignee / change stage / change schedule / change estimate / change actual hours, etc. For the structure, see references/wbs.md。

⚠️ Prerequisite: when the draft does not exist, first call wbs create-draft, then call wbs edit-draft. How to determine: directly wbs list-draft-rows and if an error of the "draft does not exist" type is reported, it is considered that the draft is missing.

wbs publish-draft

Publish the edited draft online.

⚠️ Before a full publish, you must usefixed wordingfor secondary confirmation: "All edits by yourself and collaborators will be published. Please confirm whether to publish in full?"; partial publish (passing in uuid_strings_list) does not require secondary confirmation.


Other Low-frequency Domains

For the command parameter tables for metric charts, subtasks, and relation definition queries, see references/misc.md:

  • Chart Metric Domain — chart get / chart list
  • SubTask Domain — subtask update(create/update/confirm/rollback)
  • Relation Domain — relation list / relation meta-definitions
  • WBS Plan Table · Auxiliary Commands — wbs create-draft / wbs reset-draft / wbs get-draft-progress / wbs list-element-templates(see references/wbs.md)

Field value format (field_value)

🚨 STRING protocol:field_value The protocol layer is fixed as strings. Scalars (text/number/bool/option_id/userkey/milliseconds) are directly used as strings; arrays and objectsmust first be JSON.stringify and then passed; passing directly will report need STRING type, but got: LIST / MAP. Example: the correct way to write multi-user is "[\"<userkey>\"]", and the incorrect way to write it is ["<userkey>"]。

Field Type Semantics field_value parameter passing (already serialized according to the above rules)
template Template ID (required on creation) "<template_id>" — use workitem meta-fields(field_keys=["template"]) to obtain
text / multi-pure-text / link / bool / number single literal value "需求标题" / "100" / "true"
user single userkey "<userkey>"
multi-user userkey array (stringified) "[\"<userkey1>\",\"<userkey2>\"]"
select for an existing enum item pass option_id; after confirming the addition pass free_add object (stringified) "<option_id>" / "{\"option_id\":\"<new_id>\",\"option_name\":\"<名称>\",\"free_add\":true}"
radio / tree-select enum item option_id "<option_id>"
multi-select array of option_id objects (stringified); after confirming the addition, pass option_name and free_add:true "[{\"option_id\":\"<existing_id>\"},{\"option_id\":\"<new_id>\",\"option_name\":\"<名称>\",\"free_add\":true}]"
tree-multi-select array of option_id strings (stringified) "[\"id1\",\"id2\"]"
multi-text rich text Markdown string (for syntax details, see references/rich-text-editor-markdown-syntax.md) "**加粗**内容"
date millisecond timestamp (day precision) "1722182400000"
schedule [开始ms, 结束ms](stringified) "[1722182400000,1722355199999]"
precise_date object (stringified) "{\"start_time\":1722182400000,\"end_time\":1722355199999}"
workitem_related_select related work item ID "<work_item_id>"
workitem_related_multi_select ID array (stringified, numeric elements) "[<id1>,<id2>]"
role_owners (create only) Role-person object array (stringified) "[{\"role\":\"<role_id>\",\"owners\":[\"<userkey>\"]}]"
signal option_id string (write value slot; the MQL query value slot is label, see mql-operators.md §1) "<option_id>"(subject to the workitem meta-fields of options[].option_id ; the current external signal commonly has 4 options:passed / notpassed / processing / noinformationyet)
compound_field plain compound detail table (stringified action object) "{\"action\":\"add\",\"fields\":[[{\"field_key\":\"sub_key1\",\"field_value\":\"v1\"}]]}"
multi_user_compound_field multi-user compound detail table (update existing personnel only; stringified userkey map, full overwrite) "{\"userkey1\":[{\"field_key\":\"sub_key1\",\"field_value\":\"v1\"}],\"userkey2\":[]}"

When updating a role, do not use fields; use the workitem update of role_operate parameter. select / multi-select Before writing, first exactly match existing options by option_name . If there is no match or the option list is empty, first show similar options, and ask whether to add the target value as a new option and select it; if the user has explicitly requested adding a new one, no repeated confirmation is needed. After confirmation, use free_add;option_id must be non-empty, different from option_name , and must not conflict with existing IDs.

plain compound detail table (compound_field)

When a plain compound detail table is written via workitem update ,field_value is a stringified JSON action object. Passing a JSON object directly will report during the client-side serialization stage unsupported type: map[string]interface {}, expected type: STRING。

{"action": "add", "fields": [[{"field_key": "子字段key", "field_value": "子字段值"}, ...]]}
  • action — operation type:"add"(add row),"update"(update row),"delete"(delete row)
  • fields — two-dimensional array: each outer element represents one row record, and the inner one is that row's subfield list
  • The subfield's field_value follows the STRING protocol of the respective field type (text passes a plain string, multi-user passes a stringified array, etc.)
  • The subfield key is obtained from workitem meta-fields the compound_field_info returned by
  • add No row identifier is passed; after reading the newly added result, each row will carry group_uuid
  • update / delete must pass group_uuid to locate the row as-is; the key name is exactly group_uuid,not record_id

Update one row:

{"action": "update", "group_uuid": "读回的组标识", "fields": [[{"field_key": "子字段key", "field_value": "新值"}]]}

Delete one row:

{"action": "delete", "group_uuid": "读回的组标识"}

multi-user compound detail table (multi_user_compound_field)

multi-user compound detail tabledoes not use the action / group_uuid protocol. The written value is stringified JSON map: the key is the userkey of the person filling it in, and the value is that person's subfield array.

{
  "userkey1": [
    {"field_key": "子字段key", "field_value": "子字段值"}
  ],
  "userkey2": []
}

🚨 Full overwrite, not incremental update. Passing only part of the userkeys will cause the entire rows of userkeys not included to be deleted. Before updating, you must:

  1. Use workitem get to read the current multi-user compound field; the key of the returned map is the current personnel scope, and each value contains user, and when there is a value it also contains child_field_list
  2. Use workitem meta-fields to read compound_field_info, and determine the subfield key, type, and enum option_id
  3. Rebuilda map containing all existing userkey ; the subfield values of non-target personnel must also be retained, and only the target personnel should be modified
  4. Stringify the complete map and write it back; after writing, read again to verify all personnel and the target subfields

This protocol is only used to modify workitem get currently in the mappersonnel that already exist. The metadata interface only returns the subfield configuration;workitem meta-roles Return only the role dictionary, return neither. editable_personnel_range_type, field binding roles, optional personnel, or the add-personnel protocol. If the current value is empty or the target personnel is not in the map, stop immediately and explain that the current Skill / CLI cannot automatically add personnel; the user must first add the personnel to the scope via the page, then re-read and update. Do not attempt to use {"userkey":[]} to add personnel—the API will return success but reading back will still be empty.

Enum subfields still pass option_id; the read-returned {label, value} cannot be written back as-is; instead take the option_id value from it. An empty success returned by the modify API does not mean the value has been set; you must read back; if the personnel or target value has not changed, report it as not taking effect and must not claim success.

Related work item fields (workitem_related_*)

When the user provides a name rather than an ID, follow the name→ID conversion process (search the target space + type, disambiguate, write format, prevent circular references): see references/field-value-extras.md。


Common Scenarios Quick Reference

Scenario Command (notes)
Space name → project_key project search
Query types / fields / roles workitem meta-types / workitem meta-fields / workitem meta-roles
Person name → userkey user search(batch ≤20)
Current user user me; within MQL you can directly current_login_user()
Conditional query / personal to-dos workitem query(MQL) / mywork todo
Team schedule workhour list-schedule(≤20 people, ≤3 months)
Create / modify work item workitem create / workitem update(fields fields, roles role_operate)
Node transition / status transition workflow transition(confirm/rollback) / workflow transition-state(first workflow list-state-transitions)
View data view get
Generate Meegle page link Only when the user explicitly requests a link or the link itself is a deliverable, read references/url-links.md

Link generation

Only when the user explicitly requests "give a link / assemble a link / open the address", or the link itself is the requested deliverable, read and execute references/url-links.md. Do not automatically append links to ordinary query, create, or update results.

General Specifications

Request Handling Process

After receiving user input, execute in sequence:

  1. Parameter extraction: Extract space name, work item type, time, personnel, and filter conditions from natural language; if a URL is included, first call url decode to parse, according to references/url-kinds.md 's url_kind branch decide which SOP to enter or to reject.ProhibitedExtracting path segments from the URL yourself as parameters. Note the distinction between space name and filter dimension (e.g., in "defects of the YY business line under the XX space", XX is the space name).

  2. Parameter confirmation(guessing prohibited): use probe commands to validate the space (project search), type (workitem meta-types), personnel (user search)。When probe results are not unique, you must display them and ask the user, and choosing on your own is prohibited; missing required fields should be combined into one message to ask. Personal to-dos (mywork todo) can be skipped; after a URL obtains url decode via simple_name , it still needs project search to convert to an authoritative project_key(spaces with the same name may have multiple without permission).

  3. Metadata collection(no user involvement needed): call workitem meta-fields to get field definitions (for specific fields use field_keys, for fuzzy queries use field_query)。must pass both --project-key and --work-item-typeat the same time; if either is missing, you will get erroneous / empty / cross-type polluted field configurations. For roles, call workitem meta-rolesin parallel. Key field identification: status field type=_work_item_status(values containing "complete/close/terminate" are completion states), schedule field type=schedule(for MQL use __字段名_开始时间 / __字段名_结束时间), priority field key=priority. Simple direct-call scenarios (only need project_key + work_item_id, such as comment add) can skip this step.

  4. Execute: call the target command, following references/performance.md 's parallel/pagination rules.

  5. Determine whether to continue processing: complete the part that the CLI can execute, or, after confirming that the user's request exceeds CLI capabilities, follow AI assistant continuation handling details to determine whether to provide a fallback redirect link. Links only supplement the parts that the CLI cannot complete and cannot replace data or operation results that can already be returned.

Parallelism and large results

see references/performance.md: parallel calls (chains that must be serial, combinations that can be parallelized), batching large results, and pagination rules.

Error handling

General rules: after a failure, extract the error cause from the returned err_msg / inner_err , make targeted corrections, and retry;automatically retry at most 2 times, and after 3 consecutive failures of the same type, stop and explain to the user.

Circuit-breaker conditions(terminate immediately; blind retries are prohibited):

  • Space not found (project search failed 3 consecutive times)
  • Permission Denied (the current user has no access permission to this space)
  • ai-handoff availability returns unavailable, or ai-handoff create-link returns HANDOFF_REJECTED / LOCAL_DISABLED; do not repeatedly call in order to generate a link

For detailed self-healing rules and an error quick-reference table (covering common errors such as field formats, node transitions, and personnel conversion), see references/error-handling.md。


AI assistant continuation handling

Only when the user still needs analysis, summarization, diagnosis, suggestions, or has requested an operation not supported by the CLI, read and execute references/ai-handoff.md. Core constraints:

  • First deliver the results that the CLI can complete; if the request itself is entirely unsupported by the CLI, after clarifying the capability boundary you may directly enter the continuation handling judgment, and must not fabricate a CLI output;
  • available=false or mode=off , do not generate a link;mode=auto can be generated directly,mode=ask must first obtain the user's consent;
  • generate at most one link per round, and proactively guide at most once per session; links only carry query and ID pointers, and do not claim to have passed the CLI's complete result set.

Operation guide (SOP)

For the complete process, field conversion, and self-healing mechanisms of specific operations, see the corresponding SOP: