A regular Base is a data container, composed of a Base Block resource tree and Base-level configuration.folder、table、docx、dashboard、workflow are all Block types; Advanced Permission / Role are Base-level configuration and are not Blocks. Table is the core Block that carries business data. Workspace is the outer container that organizes Bases and BaseApps; BaseApp (AppMode) organizes Base data through Pages and components, and is not an alias for Base.
Identity selection (preferred)
For Base operations, prefer using --as user; when the user explicitly requests app identity, use --as bot. For permission failures, follow lark-shared to fix the scope or resource ACL under the original identity; only switch identity when the user explicitly agrees to change the operator.
Must do before entering: resolve the target entity
Before starting operations, first determine base_token and the target entity type; when the context already provides <bitable> / <base_refer> tags and resource IDs, use them directly. In other cases, choose an entry point based on intent:
- URL or share link:
lark-cli base +url-resolve --url '<url>' --as user. The Base URL enters the corresponding module based on the returnedresource_type/block_typeand coordinates such astable_id、view_id、record_id、dashboard_id、workflow_id、docx_token、share_token; the BaseApp/app/URL returnsapp_token, and returnsworkspace_tokenandpage_idwhen carried in the link. The entity type is based on the resolution result. - Base title or keyword:
lark-cli base +title-resolve --title '<keyword>' --as user. A single result directly obtainsbase_token; for multiple candidates, disambiguate by combining title, owner, and update time, and if it still cannot be uniquely determined, ask the user to choose. Then locate the target entity according to the Base Block resource model below. - Existing Base candidate list: When the user wants to list existing Base candidates and needs to filter/sort by dimensions such as recent access, owner, creator, time, type, etc., switch to
lark-cli drive +search --doc-types bitable --as user. To locate a single Base by title/keyword, still use+title-resolve. Common candidate list commands:- Recently accessed:
lark-cli drive +search --doc-types bitable --sort open_time --opened-since 3m --page-size 20 --as user - To list only what I own: add
--mine; if you want to list "what I created", use--created-by-me。 - After getting the URL or token from the candidates, use
+url-resolveor+base-getto enter Base business commands.
- Recently accessed:
- BaseApp: Prefer using the real
/app/URL; when there is alreadyworkspace_token, you can use+workspace-entity-list --type baseappto locate. If neither is available, ask the user to provide the app link or Workspace, and do not guess globally by nameapp_token。
Read Base: For Base information use +base-get, and read the resource directory according to the Base Block resource model below.
Write Base: To create a new Base, use one +base-create --name <base-name> --table-name <table-name> --fields '<field-array>' to create the Base, first table, and fields at the same time;+base-copy copy the entire Base; resources within a Base are uniformly managed according to the Block lifecycle below.
Base Template Center
The Template Center is a public Base template library, not an existing Base in the user's cloud space. When the user wants to create a new Base using a ready-made template and there is no anchor pointing to an existing object (no Base URL, no "my/recently accessed tables", and no specific existing Base name), you can read lark-base-template-center.md to find Template Center templates;+template-categories list public template categories,+template-list List public templates by category,+template-search Search public templates by business keywords.
Base Block resource model
Base
├── Base Block 资源树
│ ├── Table Block
│ │ ├── Field schema
│ │ ├── Records / CellValue
│ │ ├── Views
│ │ └── Forms / Questions
│ ├── Dashboard Block(布局容器)
│ │ └── Dashboard 内部 Blocks(图表、指标卡、文本)
│ ├── Workflow Block
│ │ └── Workflow definition(title、status、steps 执行图)
│ ├── Docx Block → docx_token / lark-doc
│ └── Folder Block → 子 Block
└── Base 级配置
└── Advanced Permission / Roles
Each Base Block has id、type, a modifiable name, the parent_idof the Folder it belongs to, and has an order within the same-level directory.+base-block-list is the unified discovery entry point;+base-block-create creates Blocks,+base-block-rename modifies the name,+base-block-move adjusts the directory via --parent-id and adjusts the order via --before-id / --after-id ,+base-block-delete deletes Blocks. Type-specific content is then handled by the corresponding module commands.
When the type-specific initial content is already clear at creation time, you can directly use the corresponding construction command to complete it in one step: for Table use +table-create --fields, for Dashboard use +dashboard-create to set the theme, for Workflow use +workflow-create --json to submit the complete definition; Folder and Docx use +base-block-create。
The Block's id is used directly as the corresponding module coordinate by type:
| Block type | Module coordinates and internal content |
|---|---|
table |
id is table_id; internally contains Field, Record, View, and Form |
dashboard |
id is dashboard_id; internally contains Dashboard components such as charts, metric cards, and text |
workflow |
id is workflow_id; internally contains title, status, and steps execution graph |
docx |
Block additionally carries docx_token; the body is handled by lark-doc Processing |
folder |
id is the directory Block ID, and can also serve as --parent-id; only organizes child Blocks |
Table Block(The Core)
Table itself is a Base Block and also the core data storage layer of Base; Field, Record, View, and Form are internal objects of Table, not Base Blocks. Business data querying, writing, linking, statistics, and analysis all start from Table. First use +table-list to locate the Table; ordinary reads with known field names and targets can directly enter the Record command, and only tasks that depend on field type/schema, such as writing, filtering, or linking, need to add +field-list. Multi-table +field-list can be executed concurrently. Basic Record / CellValue reads and writes follow the paths below directly; reference only carries advanced analysis, the complete protocol, and boundary details.
Read Table: +table-list locates the table,+table-get reads details. Table-specific copy uses +table-copy, and asynchronous status uses +table-copy-status; schema and records are operated through the internal objects below.
Most updates under Table take effect through an asynchronous pipeline; after the interface returns success, reading immediately may temporarily not show the latest state. Prioritize the successful write response as the operation result; when a task must confirm the final state, first complete all related changes in this round, then read and verify them together, avoiding reading back immediately after writing each item.
Field
Field defines the column schema.field_id is the stable column identifier,name is the modifiable display name; Formula, Lookup, Link, Select, etc. belong to Field types or capabilities.
Read Field: +field-list / +field-get / +field-search-options。Write Field: When creating multiple fields in an existing Table, prefer passing an array of field objects to a single +field-create --json . For single-field updates and deletions use +field-update / +field-delete. For creation and update, read field-create / field-updaterespectively; the command documentation continues to route the Field JSON, Formula, and Lookup protocols.字段插件 is used to extend basic field capabilities: trigger LLM generation based on the content of other fields in the same row, and write it back to an existing target field; currently it has been confirmed that the target field supports text, single select, and number; before configuring or triggering, first read field-extension。
Record
A Record is a row of data in a Table, containing the CellValue of that record under each Field. The system record_id is the stable, non-empty, and unique primary key within the table; the Table's primary field is only a display field.
1. Read records or cells
- Given several
record_id:+record-get --record-id <id1> --record-id <id2> - Keyword search:
+record-search --keyword <text> --search-field <field>; specify at least one search field. - Other reads:
+record-list; structured conditions and sorting use--filter-json/--sort-json。
When the row count is large and server-side predicate pushdown is needed,--filter-json use tuple condition; the most common filtering and full date range syntax:
{
"logic": "and", // 全部条件成立;任一条件成立改为 "or"
"conditions": [
["状态", "intersects", ["进行中", "暂停"]], // Select 命中任一选项
["标题", "intersects", "urgent"], // 文本包含
["备注", "non_empty"], // 非空;判断为空改用 "empty",两者都不传 value
["金额", ">=", 100], // 数字比较;支持 ==、!=、>、>=、<、<=
["关联项目", "intersects", [{ "id": "recxxx" }]], // Link 包含目标记录
["业务日期", "==", "ExactDate(2026-08-07)"], // 具体一天:按 Base 时区匹配 2026-08-07 当天
["发生时间", ">", "ExactDate(2024-01-31 23:59:59.999)"], // 日期不支持 >=;用 > 前一天最后一毫秒表达含当天的下界
["发生时间", "<", "ExactDate(2024-03-01 00:00:00)"] // 2024 年 2 月范围上界:小于 3 月 1 日零点
]
}
For the complete operators and value structures of each field, read Filter condition structure。
All reads repeatedly pass --field-id to do minimal field projection, and uniformly write to an NDJSON artifact:--format ndjson --output <path>.ndjson. Each line is a Record JSON, and the stdout summary includes records_count and has_more for pagination determination.
# Example: 行数较大时先筛选 Status 包含 Doing 的记录,再导出 20 条作为局部预览
lark-cli base +record-list \
--base-token <base_token> --table-id <table_id> \
--filter-json '{"logic":"and","conditions":[["Status","intersects",["Doing"]]]}' \
--field-id Name --field-id Status --field-id Score --limit 20 \
--format ndjson --output ./records-preview.ndjson --as user
PREVIEW_ROWS=5
head -n "$PREVIEW_ROWS" ./records-preview.ndjson
tail -n "$PREVIEW_ROWS" ./records-preview.ndjson
When the estimated number of records is fewer than 500 rows, it is recommended not to do predicate pushdown and instead pull directly to the local machine for processing with jq or Python; when the row count is large, you can use --filter-json for conditions that can be expressed via pushdown; conditions that cannot be pushed down, such as regex and derived conditions, continue to be processed locally.
# jq:对服务端筛选结果追加名称格式筛选,再投影必要字段
jq -c 'select((.Name // "") | test("^Task-[0-9]+$")) | {record_id, Name}' ./records-preview.ndjson
# Python:按行读取并做简单汇总
python3 - <<'PY'
import json
with open("records-preview.ndjson", encoding="utf-8") as stream:
rows = (json.loads(line) for line in stream if line.strip())
print(sum((row.get("Score") or 0) for row in rows))
PY
--limit 's default value is 2000, and the maximum value is 2000; usually there is no need to manually specify the limit parameter; supports --offset parameter; only when has_more=false and the query range matches the problem can it be treated as a complete result. For complete reads of large tables, View range reads, complex JOINs, sets/multi-values, time series, semantic or professional statistical analysis, read Record query and analysis SOP。
2. Add records or update record cells
A Record is {字段名或 field_id: CellValue}, common CellValues:
{
"标题": "Created from shortcut", // text: string
"待确认": "请 <at user_id=ou_123/> 确认", // text(plain): 人员提及;实际 open_id 用 lark-contact 查询;不发送通知
"官网": "[官网](https://example.com)", // text(url): 裸 URL 或 Markdown link
"联系电话": "13800000000", // text(phone): 合法电话号码字符串
"邮箱": "owner@example.com", // text(email): 合法邮箱字符串
"单选": ["Todo"], // select: array<string>;单选时数组最多一个值;
"标签": ["高优", "外部依赖"], // 多选 select: array<string>;必须是当前字段存在的选项;
"工时": 8, // number: double,不经过格式化的纯数字
"带时区时间": "2026-03-24T10:00:00+08:00", // datetime:带时区,遵循传入的时区
"不带时区时间": "2026-03-24 10:00", // datetime:不带时区,自动按当前 Base 时区转换
"毫秒时间戳": 1774317600000, // datetime:也支持 Unix 毫秒时间戳
"已完成": false, // checkbox: boolean
"负责人": [{ "id": "ou_123" }], // user(multiple=false): 数组最多一个元素
"协作人": [{ "id": "ou_123" }, { "id": "ou_456" }], // user(multiple=true): 数组可包含多个元素
"群聊": [{ "id": "oc_123" }, { "id": "oc_456" }], // group_chat(multiple=true)
"关联任务": [{ "id": "rec456" }], // link: array<{id}>,record_id 来自目标表
"坐标": { "lng": 116.397428, "lat": 39.90923 }, // location: {lng,lat}
"清空": null, // 清空单元格,传 null
"清空数组": [] // 清空数组类单元格,空数组和 null 都可以
}
Attachments use dedicated shortcuts to upload, download, or remove. created_at, updated_at, created_by, updated_by, auto_number, formula, lookup type fields are read-only; if mistakenly written to a cell, they will return ignored_fields indicates that these fields were silently filtered, and the remaining fields are written normally.
# 新增:成功时返回 record_id_list
lark-cli base +record-batch-create \
--base-token <base_token> --table-id <table_id> \
--json '{"create_records":[{"Name":"Task A","Status":["Todo"]},{"Name":"Task B","Score":20}]}' --as user
# 更新:每条记录只提交要改变的字段
lark-cli base +record-batch-update \
--base-token <base_token> --table-id <table_id> \
--json '{"update_records":{"<record_id_a>":{"Status":["Done"]},"<record_id_b>":{"Score":100}}}' --as user
For large payloads, you can use a script to generate json and then use --json @file.json. A single batch can contain at most 200 records; if more, split into batches, and write serially to the same Table; parallelism may trigger 1254291 concurrency conflict errors.
3. Other Record operations
+record-delete --base-token <base_token> --table-id <table_id> --record-id <id1> --record-id <id2>Delete several records+record-share-link-create --base-token <base_token> --table-id <table_id> --record-id <id1> --record-id <id2>Create a record share link+record-history-listQuery the change events of a single record, read History record protocol- Attachments must use
+record-upload-attachment/+record-download-attachment/+record-remove-attachmentoperations.
View
View shares the underlying records of a Table; when there is no special display requirement, prefer using grid. To read an existing view, use +view-list / +view-get。
Before editing any View, must read View types and lifecycle, including creation, renaming, configuration changes (filtering, sorting, grouping, field visibility, time bar, cards) and deletion. View selection, applicable configurations, and complete operation examples are unified in that reference.
Form
A Form is attached to a Table, uses Fields as questions, and each valid submission creates a Record; suitable for information collection, external submission, conditional questions, and attachment submission.
- Read the form configuration in a Table: use
+form-list/+form-getto read the form, use+form-questions-listto read the question configuration; these commands use thebase_token + table_id。 - Create or modify the form configuration in a Table: use
+form-create/+form-update/+form-deleteManage forms; questions are carried by Table Field, and the question ID corresponds tofield_id, creation and update read questions create / questions update, and deletion uses+form-questions-delete。 - Adjust form question visibility and order: Form in the
visible_fieldsinterface acts as a View,form_idpassed to--view-id. Use+view-get-visible-fieldsto read the currently visible questions, then use+view-set-visible-fieldsto submit the complete ordered list of question IDs that should ultimately be displayed; omitting a currently visible question will hide it, adding an existing hidden Form member will show it again, and an empty list will hide all questions. The target may only contain existing Form members; thevisible_ruleof a question that is still displayed may only reference visible questions located before it. - Manage form sharing: use
+form-share-get/+form-share-updateto manage enabling/disabling, access scope, and anonymous/logged-in requirements; read the current state before updating, modify only one field at a time, and pass booleans explicitly astrueorfalse。 - Fill out and submit a shared form: for a form share link, use
+url-resolveto obtainshare_token, follow Form detail to execute+form-detailto read the real questions, required fields, and display conditions, then follow Form submit to construct fields and attachments and execute+form-submit。
Relationship between form questions and fields:
+form-questions-createsupports two forms: creating a new field question requirestitle+type; an existing field question requiresuse_existing_field:true+field_id. An existing field question merely adds that field to the form; it does not create a new field or change existing record data; do not carry field definition properties such astype、style、optionsfor this form.- Before creating a question, first
+form-questions-list. If the target title already exists, unless the user explicitly requests a separate question with the same name, prefer to use+form-questions-updateto modify the question configuration; do not first create a question with the same name and then delete the old question. +form-questions-deleteis a high-risk write operation. By default it deletes the underlying Field that carries the question and all record data of that field; if you only want to remove the question from the form while keeping the field/data, you must pass--keep-field. After keeping the field, you can use+form-questions-create --questions '[{"use_existing_field":true,"field_id":"<field_id>"}]'to add it back to the form.
Dashboard Block
Dashboard Block is the dashboard container in the Base Block tree, responsible for carrying the page theme, layout, and internal component collection; it does not itself represent a particular chart's data. Use +dashboard-list to locate the container,+dashboard-get to read container information,+dashboard-update to modify the theme, and+dashboard-arrange to orchestrate the layout of internal components uniformly.
Manage Dashboard sharing: use +dashboard-share-get / +dashboard-share-update to manage enabling/disabling, access scope, and the entry to return to the source Base; read the current state before updating, modify only one field at a time, and explicit false will be retained.
Components inside the container, such as charts, metric cards, and text, are also called Blocks in the Dashboard API, but they are not part of the Base Block tree. Internal Blocks are divided into three operation paths:
- Read configuration:
+dashboard-block-list/+dashboard-block-getread the component type, layout, anddata_config; the body of a text component also belongs to the configuration. - Write configuration:
+dashboard-block-create/+dashboard-block-update/+dashboard-block-deletemanage components,data_configdefine data sources, dimensions, metrics, aggregations, or text content. - Read content:
+dashboard-block-get-dataread the calculation results of data components such as charts and metric cards.
Before operating on an internal Block, first read Dashboard, and use that entry to continue routing component configuration and result protocols.
Application Mode and Workspace Mental Model
Workspace is the spatial container for organizing Base and BaseApp; a BaseApp must belong to a Workspace when created. BaseApp uses Page to organize the interface, and each Page contains chart, list, or rich text components; components reference Base data through data_config , but do not change the ownership relationships among Base, Table, Field, and Record. Workspace is responsible for resource ownership, App is responsible for pages and components, and Base is responsible for data.
- Workspace: use
+workspace-create、+workspace-entity-listand+workspace-move-into create directories, list the Base/BaseApp within them, or move resources in. - Application: use
+app-create/+app-get; application queries and creation depend on the realapp_token/workspace_token。 - Page: use
+app-page-list/get/create/rename/deleteto manage Page. - Component: use
+app-block-list/get/create/updateto read and write component configurations, and use+app-block-get-datato read component calculation results.
Before starting a BaseApp, Workspace, Page, or component task, fully read Application Mode and Workspace; when constructing a component data_config , continue reading Application Component Configuration. BaseApp does not follow lark-apps. Currently, BaseApp copying, complete Page copying, page icons, and moving resources out of a Workspace are not supported; when encountering these goals, handle them according to the reference's capability boundaries, and do not pretend by creating empty objects or using Drive moves.
- Page and components in BaseApp (Application Mode) use
app_token/page_id/block_id, while tables, fields, and records still use thebase_tokenof the Base referenced by the component; do not mix tokens or treat BaseApp as an alias for Base. - Reusing the
data_configof an existing BaseApp block can only serve as a structural template; before the first Create/Update, it is still necessary to align item by item with the user's explicit requirements; when the user requires sorting, you must explicitly writegroup_by[].sort.orderor the top-levelsort.order, and cannot substitute the direction omitted by the old configuration or the currentget-dataresult order. - The blocks of an application page and the blocks of a dashboard are the same underlying entity, but their ID systems are not interchangeable; select commands and configuration protocols according to the current module reference.
Workflow Block
Workflow itself is a Base Block, whose interior is an execution graph of steps connected by next / children ; triggers, actions, conditional branches, and loops are all step types. It is suitable for scheduled execution, Record creation or change linkage, message notifications, record reading and writing, and cross-system calls. Workflow is divided into three operation paths:
- Reading configuration:
+workflow-listlocate the process,+workflow-getreadtitle、statusand the completestepsexecution graph. - Writing configuration:
+workflow-createcreate the complete definition,+workflow-updateupdate the complete definition; before constructing or modifying the configuration, read Workflow, and from that entry point continue routing the step types and schema. - Run state control:
+workflow-enable/+workflow-disableenable or disable an existing Workflow without modifying the steps execution graph.
Advanced Permission(AdvPerm)
AdvPerm enables fine-grained permission mode for Base; Role, on this basis, configures access capabilities for resources such as Base, Table, View, Field, Record, Dashboard, and Docx, and is suitable for restricting visibility scope, editing capabilities, copy/download, and data access rules by team or responsibility.
Reading AdvPerm: +base-get view is_advanced,+role-list / +role-get view roles.Writing AdvPerm: +advperm-enable / +advperm-disable enable or disable advanced permissions,+role-create / +role-update / +role-delete management role. First read Permissions and roles, and use this entry to continue routing the permissions JSON protocol.
Docx Block
Docx Block is a Feishu document resource organized in a Base directory, suitable for placing descriptions, proposals, and reports together with data tables, dashboards, and workflows in the same Base; the body still uses the standard Docx data model.
From the Base Block resource directory, locate the document by --type docx and obtain docx_token; use for body reading, creation, and editing lark-doc。
Folder Block
Folder Block is only responsible for Base directory grouping and hierarchical organization. Use +base-block-list --parent-id <folder_block_id> to read direct child items.
General execution contract
- Update first confirms whether the command is a full replacement or a delta: full replacement uses the trusted current configuration for read-modify-write, while delta submits only the target changes.
- Prefer using the write return to confirm the result; only read back the target when the return is insufficient to confirm or the task explicitly requires verification.
- When a command has a confirmation gate, after confirming the target and impact, use
--yes。
Not within the scope of this Skill
- Authentication, initialization, scope, identity switching, and authorization recovery →
lark-shared - Excel、CSV、
.baseImport/export between local files such as and Base transfers tolark-drive; online copy goes through+base-copy - Body editing of Docx embedded in Base →
lark-doc; spreadsheet content operations →lark-sheets