lark-base
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesebase
base
前置条件: 先阅读。 执行前必做: 执行任何../lark-shared/SKILL.md命令前,必须先阅读对应命令的 reference 文档,再调用命令。 命名约定: 仅使用base形式的命令。lark-cli base +...
Prerequisites: Readfirst. Mandatory before execution: Before running any../lark-shared/SKILL.mdcommand, you must read the corresponding command reference document first, then invoke the command. Naming convention: Only use commands in the form ofbase.lark-cli base +...
Agent 快速执行顺序
Agent Quick Execution Sequence
- 先判断任务类型
- 临时统计 / 聚合分析 →
+data-query - 要把结果长期显示在表里 → formula 字段
- 用户明确要 lookup,或确实更适合 → lookup 字段
from/select/where/aggregate - 明细读取 / 导出 →
+record-list / +record-get
- 临时统计 / 聚合分析 →
- 先拿结构,再写命令
- 至少先拿当前表结构:或
+field-list+table-get - 跨表场景必须再查目标表的结构
- 至少先拿当前表结构:
- formula / lookup 有硬门槛
- 先读对应 guide
- 读完 guide 后,再创建对应字段
- 写记录前先判断字段可写性
- 只写存储字段
- 系统字段 / formula / lookup 默认只读
- First determine the task type
- Temporary statistics / aggregate analysis →
+data-query - Need to display results in the table long-term → formula field
- User explicitly requests lookup, or it is indeed more suitable for → lookup field
from/select/where/aggregate - Detail reading / export →
+record-list / +record-get
- Temporary statistics / aggregate analysis →
- Retrieve structure first, then write commands
- At least retrieve the current table structure first: or
+field-list+table-get - For cross-table scenarios, you must also retrieve the structure of the target table
- At least retrieve the current table structure first:
- Formula / lookup have hard thresholds
- Read the corresponding guide first
- After reading the guide, create the corresponding field
- Determine field writability before writing records
- Only write to storage fields
- System fields / formula / lookup are read-only by default
Agent 禁止行为
Agent Prohibited Behaviors
- 不要把 当聚合分析引擎
+record-list - 不要没读 guide 就直接创建 formula / lookup 字段
- 不要凭自然语言猜表名、字段名、公式表达式里的字段引用
- 不要把系统字段、formula 字段、lookup 字段当成 的写入目标
+record-upsert - 不要在 Base 场景改走
lark-cli api GET /open-apis/bitable/v1/... - 不要因为 wiki 解析结果里的 就去找
obj_type=bitable;在本 CLI 里应继续使用bitable.*lark-cli base +...
- Do not use as an aggregate analysis engine
+record-list - Do not create formula / lookup fields without reading the guide first
- Do not guess table names, field names, or field references in formula expressions based on natural language
- Do not use system fields, formula fields, or lookup fields as the target for
+record-upsert - Do not switch to for Base scenarios
lark-cli api GET /open-apis/bitable/v1/... - Do not look for just because
bitable.*appears in wiki parsing results; continue to useobj_type=bitablein this CLIlark-cli base +...
Base 基本心智模型
Basic Mental Model of Base
- Base 字段分三类
- 存储字段:真实存用户输入的数据,通常适合 写入,例如文本、数字、日期、单选、多选、人员、关联。附件字段例外:对 agent 而言,文件上传必须走
+record-upsert。+record-upload-attachment - 系统字段:平台自动维护,只读,典型包括创建时间、最后更新时间、创建人、修改人、自动编号。
- 计算字段:通过表达式或跨表规则推导,只读,典型包括 公式字段(formula) 和 查找引用字段(lookup)。
- 存储字段:真实存用户输入的数据,通常适合
- 写记录前先判断字段类别 — 只有存储字段可直接写;公式 / lookup / 创建时间 / 更新时间 / 创建人 / 修改人 / 自动编号都应视为只读输出字段,不能拿来做 入参。
+record-upsert - Base 不只是存表数据,也能内建计算 — 用户提出“统计、比较、排名、文本拼接、日期差、跨表汇总、状态判断”等需求时,不能默认导出数据后手算;要先判断是否应通过 或公式字段在 Base 内完成。
+data-query
- Base fields are divided into three categories
- Storage fields: Store user input data, typically suitable for writing, such as text, number, date, single-select, multi-select, member, association. Exception for attachment fields: For agents, file upload must go through the
+record-upsertlink.+record-upload-attachment - System fields: Automatically maintained by the platform, read-only, typically including creation time, last update time, creator, modifier, auto-number.
- Calculated fields: Derived via expressions or cross-table rules, read-only, typically including formula fields and lookup fields.
- Storage fields: Store user input data, typically suitable for
- Determine field category before writing records — Only storage fields can be written directly; formula / lookup / creation time / update time / creator / modifier / auto-number should be treated as read-only output fields and cannot be used as parameters for .
+record-upsert - Base is not just for storing table data, it can also build-in calculations — When users put forward requirements like "statistics, comparison, ranking, text concatenation, date difference, cross-table summary, status judgment", do not default to exporting data and calculating manually; first determine whether it should be completed within Base via or formula fields.
+data-query
分析路径决策
Analysis Path Decision
- 一次性分析 / 临时查询 → 优先
+data-query- 适合:分组统计、SUM / AVG / COUNT / MAX / MIN、条件筛选后聚合。
- 特征:要的是“这次算出来的结果”,不是把结果沉淀成表内字段。
- 长期复用的派生指标 / 行级计算结果 → 优先公式字段
- 适合:利润率、是否延期、剩余天数、分档标签、跨表汇总后的派生结果。
- 特征:要把结果长期显示在 Base 里,跟随记录自动更新。
- 显式要求 Lookup,或确实要按 source/select/where/aggregate 建模 → 用 lookup 字段
- 默认仍优先考虑 formula。lookup 只在用户明确要求、或更符合固定查找配置时使用。
- 原始记录读取 / 明细导出 →
+record-list / +record-get- 不要把 当分析引擎;它负责取明细,不负责聚合计算。
+record-list
- 不要把
- One-time analysis / temporary query → Prioritize
+data-query- Suitable for: Group statistics, SUM / AVG / COUNT / MAX / MIN, aggregation after conditional filtering.
- Feature: Needs "results calculated this time", not to沉淀 results as fields in the table.
- Long-term reusable derived metrics / row-level calculation results → Prioritize formula fields
- Suitable for: Profit margin, whether delayed, remaining days, grading tags, derived results after cross-table summary.
- Feature: Needs to display results in Base long-term, which update automatically with records.
- Explicitly requires Lookup, or indeed suitable for modeling with source/select/where/aggregate → Use lookup fields
- Default to prioritizing formula. Only use lookup when users explicitly request it, or when the configuration is naturally more suitable for lookup.
- Raw record reading / detail export →
+record-list / +record-get- Do not use as an analysis engine; it is responsible for retrieving details, not aggregation calculations.
+record-list
- Do not use
公式 / Lookup 专项规则
Formula / Lookup Special Rules
- 涉及 formula / lookup 时,先读 guide,再出命令
- formula:
formula-field-guide.md - lookup:
lookup-field-guide.md
- formula:
- guide 先于创建命令
- 没读对应 guide 前,不要直接创建 formula / lookup 字段
- 读完 guide 后,再补齐对应 JSON 并创建字段
- 必须提供
type=formulaexpression - 必须提供
type=lookup,必要时补from / select / whereaggregate
- 公式字段优先于 lookup 字段
- 只要用户的诉求是“计算 / 条件判断 / 文本处理 / 日期差 / 跨表聚合 / 跨表筛选后取值”,默认优先尝试 formula。
- 只有用户明确说要 lookup,或配置天然更适合 lookup 四元组时,再走 lookup。
- 表名 / 字段名必须精确匹配
- 公式、lookup、data-query 中出现的表名 / 字段名,必须来自 /
+table-list/+table-get的真实返回,禁止凭语义猜测改写。+field-list
- 公式、lookup、data-query 中出现的表名 / 字段名,必须来自
- 先拿结构再写表达式
- 公式或 lookup 一律先获取相关表结构,再生成表达式 / 配置;不要直接凭用户口述拼字段名。
- When involving formula / lookup, read the guide first, then write commands
- formula:
formula-field-guide.md - lookup:
lookup-field-guide.md
- formula:
- Guide takes precedence over creation commands
- Do not create formula / lookup fields without reading the corresponding guide first
- After reading the guide, complete the corresponding JSON and create the field
- must provide
type=formulaexpression - must provide
type=lookup, and supplementfrom / select / whereif necessaryaggregate
- Formula fields take precedence over lookup fields
- As long as the user's requirement is "calculation / conditional judgment / text processing / date difference / cross-table aggregation / value retrieval after cross-table filtering", default to trying formula first.
- Only use lookup when users explicitly mention it, or when the configuration is naturally more suitable for the lookup four-tuple.
- Table names / field names must match exactly
- Table names / field names used in formulas, lookup, data-query must come from the actual returns of /
+table-list/+table-get; guessing and rewriting based on semantics is prohibited.+field-list
- Table names / field names used in formulas, lookup, data-query must come from the actual returns of
- Retrieve structure first, then write expressions
- For formulas or lookup, always retrieve the relevant table structure first, then generate expressions / configurations; do not directly assemble field names based on user口述.
Workflow 专项规则
Workflow Special Rules
-
执行任何 workflow 命令前,必须先读两份文档:对应的命令文档 + lark-base-workflow-schema.md
- → 先读 lark-base-workflow-create.md + schema
+workflow-create - → 先读 lark-base-workflow-update.md + schema
+workflow-update - → 先读 lark-base-workflow-list.md + schema
+workflow-list - → 先读 lark-base-workflow-get.md + schema
+workflow-get - → 先读 lark-base-workflow-enable.md + schema
+workflow-enable - → 先读 lark-base-workflow-disable.md + schema
+workflow-disable - schema 中定义了所有 StepType 枚举、步骤结构、Trigger/Action/Branch/Loop 的 data 格式、值引用语法等
- 禁止凭自然语言猜测 值(如把"新增记录"猜成
type),必须从 schema 的 StepType 枚举中复制准确的类型名称CreateTrigger
-
创建前确认依赖信息
- 先通过 /
+table-list获取真实的表名、字段名+field-list - 禁止凭自然语言猜测表名/字段名填入 workflow 配置
- 先通过
-
Before executing any workflow command, you must read two documents: the corresponding command document + lark-base-workflow-schema.md
- → Read lark-base-workflow-create.md + schema first
+workflow-create - → Read lark-base-workflow-update.md + schema first
+workflow-update - → Read lark-base-workflow-list.md + schema first
+workflow-list - → Read lark-base-workflow-get.md + schema first
+workflow-get - → Read lark-base-workflow-enable.md + schema first
+workflow-enable - → Read lark-base-workflow-disable.md + schema first
+workflow-disable - The schema defines all StepType enums, step structures, data formats of Trigger/Action/Branch/Loop, value reference syntax, etc.
- Prohibit guessing values based on natural language (e.g., guessing "add record" as
type); must copy the exact type name from the StepType enum in the schemaCreateTrigger
-
Confirm dependency information before creation
- First retrieve actual table names and field names via /
+table-list+field-list - Prohibit guessing table names/field names based on natural language and filling them into workflow configurations
- First retrieve actual table names and field names via
核心规则
Core Rules
- 只使用原子命令 — 使用 这类一命令一动作的写法,不使用旧聚合式
+table-list / +table-get / +field-create / +record-upsert / +view-set-filter / +record-history-list / +base-get+table / +field / +record / +view / +history / +workspace - 写记录前先读字段结构 — 先调用 获取字段结构,再读 lark-base-shortcut-record-value.md 确认各字段类型的写入值格式
+field-list - 写字段前先看字段属性规范 — 先读 lark-base-shortcut-field-properties.md 确认 的 JSON 结构
+field-create/+field-update - 筛选查询按视图能力执行 — 先读 lark-base-view-set-filter.md 和 lark-base-record-list.md,通过 +
+view-set-filter组合完成筛选读取+record-list - 对记录进行分析(涉及"最高/最低/总计/平均/排名/比较/数量"等分析意图) — 先读 lark-base-data-query.md,通过 进行数据筛选聚合的服务端计算
+data-query - 聚合分析与取数互斥 — 需要分组统计 / SUM / MAX / AVG / COUNT 时,必须使用 (服务端计算),禁止用
+data-query拉全量记录再手动计算;反之,+record-list不返回原始记录,取数场景仍走+data-query+record-list / +record-get - 所有 禁止并发调用 —
+xxx-list只能串行执行+table-list / +field-list / +record-list / +view-list / +record-history-list / +role-list - 批量上限 500 条/次 — 同一表建议串行写入,并在批次间延迟 0.5–1 秒
- 统一参数名 — 一律使用 ,不使用旧
--base-token--app-token - 遇到“公式 / 查找引用 / 派生指标 / 跨表计算”需求,优先走字段方案判断 — 先判断应建 formula / lookup 字段,还是只做一次性
+data-query - 公式、lookup、系统字段默认视为只读 — 除 维护字段定义外,不要把这些字段作为记录写入目标
+field-create / +field-update - 改名和删除按明确意图执行 — 在目标视图和新名称都明确时可直接执行;
+view-rename在用户已经明确要求删除且目标明确时也可直接执行,不需要再补一次确认,并且执行删除命令时要主动补上+record-delete / +field-delete / +table-delete;只有目标不明确时才继续追问--yes
- Only use atomic commands — Use commands like which perform one action per command, instead of the old aggregate-style
+table-list / +table-get / +field-create / +record-upsert / +view-set-filter / +record-history-list / +base-get+table / +field / +record / +view / +history / +workspace - Read field structure before writing records — First call to retrieve field structure, then read lark-base-shortcut-record-value.md to confirm the write value format for each field type
+field-list - Check field property specifications before writing fields — First read lark-base-shortcut-field-properties.md to confirm the JSON structure for
+field-create/+field-update - Execute filter queries according to view capabilities — First read lark-base-view-set-filter.md and lark-base-record-list.md, and complete filter reading via the combination of +
+view-set-filter+record-list - Analyze records (involving analysis intentions like "highest/lowest/total/average/ranking/comparison/quantity") — First read lark-base-data-query.md, and perform server-side calculation of data filtering and aggregation via
+data-query - Aggregation analysis and data retrieval are mutually exclusive — When group statistics / SUM / MAX / AVG / COUNT are needed, must use (server-side calculation); prohibit pulling all records with
+data-queryand then calculating manually; conversely,+record-listdoes not return raw records, so data retrieval scenarios still use+data-query+record-list / +record-get - All commands are prohibited from concurrent calls —
+xxx-listcan only be executed serially+table-list / +field-list / +record-list / +view-list / +record-history-list / +role-list - Batch limit: 500 items per time — It is recommended to write to the same table serially, with a 0.5–1 second delay between batches
- Unified parameter name — Always use , do not use the old
--base-token--app-token - For requirements involving "formula / lookup reference / derived metric / cross-table calculation", prioritize field scheme judgment — First determine whether to create formula / lookup fields, or just perform a one-time
+data-query - Formula, lookup, and system fields are read-only by default — Except for maintaining field definitions via , do not use these fields as record writing targets
+field-create / +field-update - Execute renaming and deletion according to explicit intentions — can be executed directly when both the target view and new name are clear;
+view-renamecan also be executed directly when the user has clearly requested deletion and the target is clear, no need for additional confirmation, and+record-delete / +field-delete / +table-deletemust be actively added when executing the delete command; only continue to ask questions when the target is unclear--yes
问卷 / 表单提示
Form / Questionnaire Tips
- 获取问卷列表:使用 (先拿
+form-list)form-id - 获取单个问卷:使用
+form-get - 获取表单 / 问卷问题:使用
+form-questions-list - 删除问卷 / 表单问题:使用
+form-questions-delete - 创建 / 更新问题:使用
+form-questions-create / +form-questions-update
- Get questionnaire list: Use (get
+form-listfirst)form-id - Get single questionnaire: Use
+form-get - Get form / questionnaire questions: Use
+form-questions-list - Delete questionnaire / form questions: Use
+form-questions-delete - Create / update questions: Use
+form-questions-create / +form-questions-update
意图 → 命令索引
Intent → Command Index
| 意图 | 推荐命令 | 备注 |
|---|---|---|
| 列表 / 获取数据表 | | 原子命令 |
| 创建 / 更新 / 删除数据表 | | 一命令一动作 |
| 列表 / 获取字段 | | 原子命令 |
| 创建 / 更新字段 | | 使用 |
| 创建 / 更新公式字段 | | |
| 创建 / 更新 lookup 字段 | | |
| 列表 / 获取记录 | | 原子命令,如果需要 |
| 创建 / 更新记录 | | |
| 聚合分析 / 比较排序 / 求最值 / 筛选统计 | | 不要用 |
| 配置 / 查询视图 | | |
| 查看记录历史 | | 按表和记录查询变更历史 |
| 按视图筛选查询 | | 组合调用 |
| 创建 / 获取 / 复制 Base | | 原子命令 |
| 列表 / 获取工作流 | | 原子命令 |
| 创建 / 更新工作流 | | 使用 |
| 启用 / 停用工作流 | | 一命令一动作 |
| 启用 / 停用高级权限 | | 启用后才能使用自定义角色;停用会使已有角色失效 |
| 列表 / 获取角色 | | 查看角色摘要或完整配置 |
| 创建 / 更新 / 删除角色 | | 管理自定义角色权限 |
| 列表 / 获取表单 | | 原子命令 |
| 创建 / 更新 / 删除表单 | | 一命令一动作 |
| 列表 / 创建 / 更新 / 删除表单问题 | | 一命令一动作 |
| 列表 / 获取仪表盘 | | 原子命令 |
| 创建 / 更新 / 删除仪表盘 | | 一命令一动作 |
| 列表 / 获取仪表盘 Block | | 原子命令 |
| 创建 / 更新 / 删除仪表盘 Block | | 一命令一动作 |
| Intent | Recommended Command | Remarks |
|---|---|---|
| List / Get data tables | | Atomic command |
| Create / Update / Delete data tables | | One action per command |
| List / Get fields | | Atomic command |
| Create / Update fields | | Use |
| Create / Update formula fields | | |
| Create / Update lookup fields | | |
| List / Get records | | Atomic command; For |
| Create / Update records | | |
| Aggregate analysis / Comparison sorting / Get min/max / Filter statistics | | Do not use |
| Configure / Query views | | |
| View record history | | Query record history by table and record |
| Filter query by view | | Combined call |
| Create / Get / Copy Base | | Atomic command |
| List / Get workflows | | Atomic command |
| Create / Update workflows | | Use |
| Enable / Disable workflows | | One action per command |
| Enable / Disable advanced permissions | | Advanced permissions must be enabled to use custom roles; Disabling will invalidate existing roles |
| List / Get roles | | View role summary or complete configuration |
| Create / Update / Delete roles | | Manage custom role permissions |
| List / Get forms | | Atomic command |
| Create / Update / Delete forms | | One action per command |
| List / Create / Update / Delete form questions | | One action per command |
| List / Get dashboards | | Atomic command |
| Create / Update / Delete dashboards | | One action per command |
| List / Get dashboard Blocks | | Atomic command |
| Create / Update / Delete dashboard Blocks | | One action per command |
操作注意事项
Operation Notes
- Base token 口径统一:统一使用
--base-token - 调用纪律:
+xxx-list禁止并发调用;批量执行时只能串行+table-list / +field-list / +record-list / +view-list / +record-history-list / +role-list / +dashboard-list / +dashboard-block-list / +workflow-list - limit 上限:
+record-list最大--limit。需要更多数据时必须用分页(200递增)分批拉取,禁止单次传超过offset200 - 字段可写性先判断:存储字段才可写;公式 / lookup / 系统字段默认只读,写记录时应跳过
- 公式能力要主动想到:用户说“算一下”“生成标签”“判断是否异常”“跨表汇总”“按日期差预警”时,要先判断是否应该建公式字段,而不是只返回手工分析方案
- lookup 不是默认首选:lookup 只在用户明确要求或确实更适合固定查找模型时使用;常规计算、跨表聚合和条件判断优先 formula
- 附件字段:如果用户要“上传附件 / 给记录加文件”,只能走 这条链路(读字段 → 读记录 → 上传素材 → 回写记录)
+record-upload-attachment - 人员字段 / 用户字段:调试时注意 与执行身份(user / bot)差异
user_id_type - history 使用方式:按
+record-history-list查询记录历史,不支持整表历史扫描table-id + record-id - workspace 状态:已接入
+base-create / +base-get / +base-copy - 结果返回规范:创建或复制成功后,回复中必须主动返回新 Base 的标识信息。若返回结果里带可访问链接(如
+base-create / +base-copy),要一并返回base.url - 友好性规则:
+base-create / +base-copy、--folder-token、复制时的--time-zone都是可选项。用户没有特别要求时,不要为了这些可选参数额外打断;能直接创建/复制就直接执行--name - 权限处理(bot 创建):若 Base 由应用身份(bot)创建,创建或复制成功后默认继续使用 bot 身份为当前可用 user(指当前 CLI 中 auth 模块已登录且可用的用户身份)添加
+base-create / +base-copy(管理员)权限,并在回复中明确授权结果(成功 / 无可用 user / 授权失败及原因)。若授权未完成,要继续给出后续引导(稍后重试授权或继续用 bot);owner 转移必须单独确认,禁止擅自执行full_access - dashboard 使用方式:创建后返回
+dashboard-create;Block 的dashboard_id通过 JSON 字符串传入,支持data_config读取文件@file.json - advperm 使用方式:启用高级权限后才能管理角色(
+advperm-enable);+role-*是高风险操作,停用后已有自定义角色全部失效;操作用户必须为 Base 管理员;先读 lark-base-advperm-enable.md / lark-base-advperm-disable.md+advperm-disable - role 使用方式:仅支持
+role-create;custom_role采用 Delta Merge(+role-update和role_name必须始终提供);role_type不可逆且仅支持自定义角色;角色配置支持+role-delete(Base 级复制/下载)、base_rule_map(表级权限含记录/字段粒度)、table_rule_map(仪表盘权限)、dashboard_rule_map(文档权限);写角色前先读 role-config.mddocx_rule_map - 表单 form-id:通过 获取;
+form-list返回的+form-create即id,可用于form-id操作+form-questions-* - workflow 使用方式:在创建或更新 workflow 前,必须仔细阅读 lark-base-workflow-schema.md 了解各触发器和节点组件的结构;同时 返回的不是完整树状结构,若需读取完整结构请使用
+workflow-list。+workflow-get - data-query 使用方式:使用 前必须先阅读 lark-base-data-query.md 了解 DSL 结构、支持的字段类型、聚合函数和限制条件;DSL 中的
+data-query必须与表字段名精确匹配,构造前先用field_name获取真实字段名+field-list - 公式 / lookup 使用方式:构造表达式或 where 条件前,至少先拿当前表结构;跨表时要查找目标表的结构,不允许凭自然语言猜字段名
- 视图重命名确认规则:用户已经明确“把哪个视图改成什么名字”时,直接执行即可,不需要再补一句确认
+view-rename - 删除确认规则(记录 / 字段 / 表):如果用户已经明确说要删除,并且目标也明确,可直接执行,不需要再补一次确认;执行时直接带
+record-delete / +field-delete / +table-delete通过 CLI 的高风险写入校验。只有目标仍有歧义时,再先用--yes或 list 命令确认+record-get / +field-get / +table-get
- Unified Base token specification: Use uniformly
--base-token - Discipline for calls: Concurrent calls to
+xxx-listare prohibited; must execute serially during batch execution+table-list / +field-list / +record-list / +view-list / +record-history-list / +role-list / +dashboard-list / +dashboard-block-list / +workflow-list - limit upper limit: The maximum value of
+record-listis--limit. When more data is needed, must use pagination (increment200) to pull in batches; passing more thanoffsetat a time is prohibited200 - Determine field writability first: Only storage fields can be written; formula / lookup / system fields are read-only by default and should be skipped when writing records
- Proactively consider formula capabilities: When users say "calculate" "generate tags" "judge abnormality" "cross-table summary" "alert by date difference", first determine whether formula fields should be created instead of only returning manual analysis solutions
- Lookup is not the default first choice: Lookup is only used when users explicitly request it or it is indeed more suitable for fixed lookup models; formula is prioritized for regular calculations, cross-table aggregation and conditional judgments
- Attachment fields: If users want to "upload attachments / add files to records", only use the link (read field → read record → upload material → write back record)
+record-upload-attachment - Member fields / User fields: Pay attention to the difference between and execution identity (user / bot) during debugging
user_id_type - History usage: queries record history by
+record-history-list, and does not support full-table history scanningtable-id + record-id - Workspace status: Integrated with
+base-create / +base-get / +base-copy - Result return specification for : After successful creation or copying, the identification information of the new Base must be actively returned in the reply. If the return result contains an accessible link (such as
+base-create / +base-copy), it should also be returned togetherbase.url - Friendliness rules for :
+base-create / +base-copy,--folder-token, and--time-zoneduring copying are optional parameters. Do not interrupt the process for these optional parameters when users have no special requirements; execute creation/copy directly if possible--name - Permission handling for (bot creation): If the Base is created by an application identity (bot), after successful creation or copying, continue to use the bot identity to add
+base-create / +base-copy(administrator) permission to the currently available user (referring to the user identity that has logged in and is available in the auth module of the current CLI), and clearly state the authorization result (success / no available user / authorization failure and reason) in the reply. If authorization is not completed, provide subsequent guidance (retry authorization later or continue using bot); owner transfer must be confirmed separately, unauthorized execution is prohibitedfull_access - Dashboard usage: returns
+dashboard-createafter creation;dashboard_idof Block is passed in via JSON string, and supports reading files viadata_config@file.json - Advperm usage: Advanced permissions must be enabled via to manage roles (
+advperm-enable);+role-*is a high-risk operation, and all existing custom roles will become invalid after disabling; the operating user must be a Base administrator; read lark-base-advperm-enable.md / lark-base-advperm-disable.md first+advperm-disable - Role usage: only supports
+role-create;custom_roleuses Delta Merge (+role-updateandrole_namemust always be provided);role_typeis irreversible and only supports custom roles; role configuration supports+role-delete(Base-level copy/download),base_rule_map(table-level permissions including record/field granularity),table_rule_map(dashboard permissions),dashboard_rule_map(document permissions); read role-config.md before writing rolesdocx_rule_map - Form form-id: Obtained via ; The
+form-listreturned byidis+form-create, which can be used forform-idoperations+form-questions-* - Workflow usage: Before creating or updating a workflow, you must carefully read lark-base-workflow-schema.md to understand the structure of each trigger and node component; meanwhile, does not return the complete tree structure, so use
+workflow-listif you need to read the complete structure.+workflow-get - Data-query usage: Before using , you must read lark-base-data-query.md to understand the DSL structure, supported field types, aggregation functions and restrictions;
+data-queryin DSL must match the table field name exactly, retrieve real field names withfield_namebefore constructing+field-list - Formula / lookup usage: Before constructing expressions or where conditions, at least retrieve the current table structure first; for cross-table scenarios, retrieve the structure of the target table; guessing field names based on natural language is not allowed
- View rename confirmation rule: When the user has clearly specified "which view to rename to what name", can be executed directly without additional confirmation
+view-rename - Delete confirmation rule (records / fields / tables): If the user has clearly stated to delete and the target is clear, can be executed directly without additional confirmation; add
+record-delete / +field-delete / +table-deletedirectly when executing to pass the CLI's high-risk write check. Only use--yesor list commands to confirm when the target is ambiguous+record-get / +field-get / +table-get
Wiki 链接特殊处理(特别关键!)
Special Handling of Wiki Links (Extremely Critical!)
知识库链接()背后可能是云文档、电子表格、多维表格等不同类型的文档。不能直接假设 URL 中的 token 就是 file_token,必须先查询实际类型和真实 token。
/wiki/TOKENKnowledge base links () may correspond to different document types such as cloud documents, spreadsheets, multidimensional tables, etc. Do not directly assume that the token in the URL is the file_token; you must first query the actual type and real token.
/wiki/TOKEN处理流程
Processing Flow
-
使用查询节点信息
wiki.spaces.get_nodebashlark-cli wiki spaces get_node --params '{"token":"<wiki_token>"}' -
从返回结果中提取关键信息
- :文档类型(docx/doc/sheet/bitable/slides/file/mindnote)
node.obj_type - :真实的文档 token(用于后续操作)
node.obj_token - :文档标题
node.title
-
根据选择后续命令
obj_type| obj_type | 说明 | 后续命令 | |----------|------|-----------| || 新版云文档 |docx、drive file.comments.*| |docx.*| 旧版云文档 |doc| |drive file.comments.*| 电子表格 |sheet| |sheets.*| 多维表格 |bitable(优先);如果 shortcut 不覆盖,再用lark-cli base +...;不要改走lark-cli base <resource> <method>| |lark-cli api /open-apis/bitable/v1/...| 幻灯片 |slides| |drive.*| 文件 |file| |drive.*| 思维导图 |mindnote|drive.* -
把 wiki 解析出的当成 Base token 使用
obj_token- 当 时,
obj_type=bitable就是后续node.obj_token命令应使用的真实 token。base - 也就是说:如果原始输入是 链接,不要把
/wiki/...直接塞给wiki_token。--base-token
- 当
-
如果已经报了 token 错,再回退检查 wiki
- 如果命令返回 、
param baseToken is invalid、base_token invalid,并且用户最初给的是not found链接或/wiki/...,优先怀疑“把 wiki token 当成了 base token”。wiki_token - 这时不要改走 API;应立即重新执行
bitable/v1,确认lark-cli wiki spaces get_node后,改用obj_type=bitable重新执行node.obj_token。lark-cli base +...
- 如果命令返回
-
Query node information using
wiki.spaces.get_nodebashlark-cli wiki spaces get_node --params '{"token":"<wiki_token>"}' -
Extract key information from the return result
- : Document type (docx/doc/sheet/bitable/slides/file/mindnote)
node.obj_type - : Real document token (used for subsequent operations)
node.obj_token - : Document title
node.title
-
Select subsequent commands based on
obj_type| obj_type | Description | Subsequent Commands | |----------|------|-----------| || New version cloud document |docx、drive file.comments.*| |docx.*| Old version cloud document |doc| |drive file.comments.*| Spreadsheet |sheet| |sheets.*| Multidimensional table |bitable(priority); if shortcut does not cover, uselark-cli base +...; Do not switch tolark-cli base <resource> <method>| |lark-cli api /open-apis/bitable/v1/...| Slides |slides| |drive.*| File |file| |drive.*| Mind map |mindnote|drive.* -
Useparsed from wiki as Base token
obj_token- When ,
obj_type=bitableis the real token that should be used for subsequentnode.obj_tokencommands.base - That is: If the original input is a link, do not directly use
/wiki/...aswiki_token.--base-token
- When
-
If token error occurs, fallback to check wiki
- If the command returns ,
param baseToken is invalid,base_token invalid, and the user initially provided anot foundlink or/wiki/..., first suspect that "wiki token is used as base token".wiki_token - At this time, do not switch to API; immediately re-execute
bitable/v1, confirmlark-cli wiki spaces get_node, then re-executeobj_type=bitableusinglark-cli base +....node.obj_token
- If the command returns
查询示例
Query Example
bash
undefinedbash
undefined查询 wiki 节点
Query wiki node
lark-cli wiki spaces get_node --params '{"token":"Pgrr***************UnRb"}'
返回结果示例:
```json
{
"node": {
"obj_type": "docx",
"obj_token": "UAJ***************E9nic",
"title": "ai friendly 测试 - 1 副本",
"node_type": "origin",
"space_id": "6946843325487906839"
}
}lark-cli wiki spaces get_node --params '{"token":"Pgrr***************UnRb"}'
Return result example:
```json
{
"node": {
"obj_type": "docx",
"obj_token": "UAJ***************E9nic",
"title": "ai friendly test - 1 copy",
"node_type": "origin",
"space_id": "6946843325487906839"
}
}Base 链接解析规则
Base Link Parsing Rules
| 链接类型 | 格式 | 处理方式 |
|---|---|---|
| 直接 Base 链接 | | 直接提取作为 |
| Wiki 知识库链接 | | 先调用 |
| Link Type | Format | Handling Method |
|---|---|---|
| Direct Base link | | Extract directly as |
| Wiki knowledge base link | | Call |
URL 参数提取
URL Parameter Extraction
https://{domain}/base/{base-token}?table={table-id}&view={view-id}- →
/base/{token}--base-token - →
?table={id}--table-id - →
?view={id}--view-id
https://{domain}/base/{base-token}?table={table-id}&view={view-id}- →
/base/{token}--base-token - →
?table={id}--table-id - →
?view={id}--view-id
禁止事项
Prohibited Items
- 禁止将完整 URL 直接作为 参数传入
--base-token - 禁止将 wiki_token 直接作为
--base-token
- Prohibit directly passing the complete URL as the parameter
--base-token - Prohibit directly using wiki_token as
--base-token
常见错误速查
Quick Check of Common Errors
| 错误码 | 含义 | 解决方案 |
|---|---|---|
| 1254064 | 日期格式错误 | 用毫秒时间戳,非字符串 / 秒级 |
| 1254068 | 超链接格式错误 | 用 |
| 1254066 | 人员字段错误 | 用 |
| 1254045 | 字段名不存在 | 检查字段名(含空格、大小写) |
| 1254015 | 字段值类型不匹配 | 先 |
| 把 wiki token、workspace token 或其他 token 当成了 | 如果输入来自 |
| formula / lookup 创建失败 | 指南未读或结构不合法 | 先读 |
| 系统字段 / 公式字段写入失败 | 只读字段被当成可写字段 | 改为写存储字段,计算结果交给 formula / lookup / 系统字段自动产出 |
| 1254104 | 批量超 500 条 | 分批调用 |
| 1254291 | 并发写冲突 | 串行写入 + 批次间延迟 |
| Error Code | Meaning | Solution |
|---|---|---|
| 1254064 | Incorrect date format | Use millisecond timestamp instead of string / second-level timestamp |
| 1254068 | Incorrect hyperlink format | Use |
| 1254066 | Member field error | Use |
| 1254045 | Field name does not exist | Check field name (including spaces, case) |
| 1254015 | Field value type mismatch | Call |
| Wiki token, workspace token or other tokens are used as | If the input comes from a |
| Formula / lookup creation failed | Guide not read or structure is invalid | Read |
| Failed to write to system fields / formula fields | Read-only fields are treated as writable | Switch to writing storage fields, and let formula / lookup / system fields automatically generate calculation results |
| 1254104 | Batch exceeds 500 items | Call in batches |
| 1254291 | Concurrent write conflict | Write serially + add delay between batches |
参考文档
Reference Documents
- lark-base-shortcut-field-properties.md — JSON 规范(推荐)
+field-create/+field-update - role-config.md — 角色权限配置详解
- lark-base-shortcut-record-value.md — 值格式规范(推荐)
+record-upsert - formula-field-guide.md — formula 字段写法、函数约束、CurrentValue 规则、跨表计算模式(强烈推荐)
- lookup-field-guide.md — lookup 字段配置规则、where/aggregate 约束、与 formula 的取舍
- lark-base-view-set-filter.md — 视图筛选配置
- lark-base-record-list.md — 记录列表读取与分页
- lark-base-advperm-enable.md — 启用高级权限
+advperm-enable - lark-base-advperm-disable.md — 停用高级权限
+advperm-disable - lark-base-role-list.md — 列出角色
+role-list - lark-base-role-get.md — 获取角色详情
+role-get - lark-base-role-create.md — 创建角色
+role-create - lark-base-role-update.md — 更新角色
+role-update - lark-base-role-delete.md — 删除角色
+role-delete - lark-base-dashboard.md — dashboard 命令索引(每个命令已拆到独立文档)
- lark-base-dashboard-block.md — dashboard block 命令索引(每个命令已拆到独立文档)
- dashboard-block-data-config.md — Block data_config 结构、图表类型、filter 规则
- lark-base-workflow.md — workflow 命令索引
- lark-base-workflow-schema.md — JSON body 数据结构详解,包含触发器及各类节点的配置规则(强烈推荐)
+workflow-create/+workflow-update - lark-base-data-query.md — 聚合分析(DSL 结构、支持字段类型、聚合函数)
+data-query - examples.md — 完整操作示例(建表、导入、筛选、更新)
- lark-base-shortcut-field-properties.md — JSON specification for (recommended)
+field-create/+field-update - role-config.md — Detailed explanation of role permission configuration
- lark-base-shortcut-record-value.md — Value format specification for (recommended)
+record-upsert - formula-field-guide.md — Formula field syntax, function constraints, CurrentValue rules, cross-table calculation mode (highly recommended)
- lookup-field-guide.md — Lookup field configuration rules, where/aggregate constraints, trade-off with formula
- lark-base-view-set-filter.md — View filter configuration
- lark-base-record-list.md — Record list reading and pagination
- lark-base-advperm-enable.md — to enable advanced permissions
+advperm-enable - lark-base-advperm-disable.md — to disable advanced permissions
+advperm-disable - lark-base-role-list.md — to list roles
+role-list - lark-base-role-get.md — to get role details
+role-get - lark-base-role-create.md — to create roles
+role-create - lark-base-role-update.md — to update roles
+role-update - lark-base-role-delete.md — to delete roles
+role-delete - lark-base-dashboard.md — Dashboard command index (each command has been split into independent documents)
- lark-base-dashboard-block.md — Dashboard block command index (each command has been split into independent documents)
- dashboard-block-data-config.md — Block data_config structure, chart types, filter rules
- lark-base-workflow.md — Workflow command index
- lark-base-workflow-schema.md — Detailed explanation of JSON body data structure for , including configuration rules for triggers and various nodes (highly recommended)
+workflow-create/+workflow-update - lark-base-data-query.md — aggregate analysis (DSL structure, supported field types, aggregation functions)
+data-query - examples.md — Complete operation examples (table creation, import, filter, update)
命令分组
Command Groups
执行前必做: 从下表定位到命令后,务必先阅读对应命令的 reference 文档,再调用命令。
| 命令分组 | 说明 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Mandatory before execution: After locating the command from the table below, be sure to read the corresponding command reference document first, then invoke the command.
| Command Group | Description |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |