lark-sheets

SkillCommunityTranslated from Chinese

This skill enables AI agents to interact with Lark (Feishu) online spreadsheets. It supports creating and managing spreadsheets, manipulating sheet structures, reading and writing cell data, performing batch operations, and managing objects like charts, pivot tables, and conditional formatting.

Install:
npx skills add open.feishu.cn/lark-sheets

sheets

CRITICAL, Before starting, you MUST use the Read tool to read ../lark-shared/SKILL.md, which contains information on authentication and permission handling.

Terminology Conventions

The following terms may appear interchangeably in the documentation for this skill, but they refer to the same object. When parsing user input, map them accordingly; do not treat them as distinct concepts:

Standard TermSynonyms / Colloquialisms (refer to the same object)Note
sheetsub-sheet, tab, pageA single sheet within a spreadsheet; sheet_id is its stable identifier
spreadsheetworkbook, tableThe top-level container; located by --url or --spreadsheet-token
reference_ididThe stable identifier for an object within a sheet, which is the value accepted by the primary key flag for each object (see table below). ⚠️ This is not the same as the --image-uri (image upload handle) for lark-sheets-float-image, which is not a reference_id

Each object type is located using its own primary key flag (naming is inconsistent; use this table for reference, do not guess):

ObjectPrimary Key FlagObjectPrimary Key Flag
sheet--sheet-idconditional formatting rule--rule-id
chart--chart-idfilter view--view-id
pivot table--pivot-table-idsparkline (by group)--group-id
float image--float-image-id

Scenario → Command Quick Reference (Check here before guessing command names)

Map high-frequency intents to existing shortcuts / flags. Agents often incorrectly migrate command names or flags from Excel / Google Sheets / Lark OpenAPI. Check this table first to avoid inevitable trial-and-error failures. See individual tool references for complete shortcuts.

What you want to do✅ Correct Syntax❌ Does not exist (will be rejected by cobra)
Read data (raw values / CSV)+csv-get (use --range for range),
Read values + formulas / styles / comments+cells-get --include value,formula,style,comment,data_validation--with-styles, --with-merges, --include-merged-cells
Write raw values (CSV block)+csv-put (use --start-cell for positioning, a single top-left anchor cell; also accepts --range alias, automatically taking the top-left),
Write values / formulas / styles+cells-set (use --range for positioning),
Find cells+cells-search (use --find for keyword)+cells-find, +find, --query
Find and replace+cells-replace,
View sheet structure (merges / row height / column width / freeze / hide)+sheet-info+sheet-get, +structure-get, +sheet-structure-get
View workbook / sheet list+workbook-info,
Export xlsx / single sheet csv+workbook-export,
Clear content / formats+cells-clear (use --scope for dimension, values: content / formats / all)--type
Batch clear multiple areas+cells-batch-clear (--scope)--target
Adjust column width / row height+cols-resize / +rows-resize (rows and columns are separate commands)--dimension (flag does not exist)
Group summary / pivot+pivot-create (default: no target flag → automatically creates a new sheet, zero overwrite)Using SUMIF / local scripts to build a fake pivot table

⚠️ Positioning flags: +cells-get / +cells-set / +csv-get use --range; +csv-put standardly uses --start-cell (a single top-left anchor cell), but also accepts the --range alias (automatically taking the top-left). Use either one. ⚠️ Reading additional information always goes through +cells-get --include .... There is no --with-styles flag. To view merged cells, use merged_cells in +sheet-info; do not look for a merge flag in +cells-get.

References

References for this skill are divided into two groups: first, read the General Methods and Standards (workflows, ironclad rules, styles, formula rules that cut across all tasks, excluding specific shortcuts) to understand "how to do it right." Then, proceed to Tool References based on the object of operation to check specific shortcuts and call details. For editing tasks, be sure to review the general methods first, as the ironclad rules apply to all tool references.

General Methods and Standards (Read first, applies to all tasks, no specific shortcuts)

ReferenceDescription
Lark Sheets Core Operations: Analysis, Editing, and VisualizationCore workflow for Lark Sheets. Use when users need to view, analyze, edit, or visualize existing Lark Sheets. Applicable scenarios: data query and statistics, formula calculation, table beautification, creating charts/pivot tables, filtering and sorting, batch data modification, adjusting table structure, etc. Even if the user does not explicitly say "Lark Sheets," if the object is an existing online sheet, this workflow should be triggered. Not applicable to local Excel files.
Lark Sheets Style and Color StandardsStandards for Lark Sheets styles and colors: color, font size, alignment, and border standards for headers/data areas/summary rows, as well as decision processes and style points for adding summary rows, appending rows/columns while inheriting styles, and beautifying existing areas. For tool call parameter details, refer to lark-sheets-write-cells / lark-sheets-range-operations / lark-sheets-batch-update. For conditional formatting (highlighting, red marking, data bars, color scales), use lark-sheets-conditional-format. Only for Lark Sheets, not applicable to local Excel files.
Lark Sheets Formula Generation RulesMigration and generation rules for Excel formulas to Lark Sheets formulas. The core goal is not to preserve original Excel syntax, but to rewrite formulas according to Lark Sheets executable rules while aligning results with Excel as much as possible. Use when users ask to rewrite Excel formulas into Lark Sheets formulas or need to generate Lark formulas (especially involving ARRAYFORMULA, native array functions, INDEX/OFFSET, MAP/LAMBDA, date differences, multi-layer range results, and secondary expansion). Only for Lark online sheets, not applicable to local Excel files.

Tool References by Object (includes shortcuts)

ReferenceDescription
Lark Sheet WorkbookManage Lark Sheets workbook structure (sheet list and metadata). Use when users mention "see what's in this table," "table structure," "what sheets are there," "create a new sheet," "delete this sheet," "rename," "copy," or "move to front." Only for Lark Sheets.
Lark Sheet Sheet StructureManage Lark Sheets sub-sheet structure and layout. Applicable scenarios: viewing row height, column width, hidden rows/columns, merged cells, and operations like "insert row," "delete column," "hide row," "freeze header," and row/column grouping (outline collapse/expand). Row/column outlines are only triggered when the user explicitly mentions "row grouping," "column grouping," "outline," etc. For data grouping scenarios like "group by XXX," use lark-sheets-pivot-table. To append data to the end of a sheet, first insert rows using this skill, then write using lark-sheets-write-cells. Only for Lark Sheets.
Lark Sheet Read DataRead cell data in Lark Sheets. Use when users need to "see data," "analyze data," or "calculate/summarize." Also applicable for viewing formulas, styles, comments, and other detailed information. Only for Lark Sheets.
Lark Sheet Search & ReplaceSearch and replace text in Lark Sheets, supporting range limits, case matching, exact matching, and regular expressions. Use when users need to "find," "search," "locate" a value, or "replace," "batch modify text," or "change A to B." Do not use for understanding table structure (read data instead) or data analysis (read data then calculate). Do not treat keywords in user action descriptions (like "summarize amount" or "count quantity") as search terms. Only for Lark Sheets.
Lark Sheet Write CellsBatch write values, formulas, styles, comments, or cell images to specified areas in Lark Sheets. Applicable scenarios: filling data, setting formulas, modifying formats, adding comments, embedding cell images (for floating images, use lark-sheets-float-image). If you only need to lay out a block of raw CSV values (without formulas/styles), +csv-put is shorter and faster. Appending data requires inserting rows/columns via lark-sheets-sheet-structure first. Only for Lark Sheets.
Lark Sheet Range OperationsPerform structural operations on specified areas in Lark Sheets (not involving writing cell data values). Applicable scenarios: clearing content or formats ("clear," "delete content," "remove format"), merging/unmerging cells, adjusting row height/column width ("widen column," "auto-fit column width"), moving/copying/filling/sorting data ("move data," "copy to," "auto-fill," "sort by column"). To write cell data, use lark-sheets-write-cells. Only for Lark Sheets.
Lark Sheet Batch UpdateCombine multiple Lark Sheets write operations into a single batch execution, completed in sequence. Suitable for scenarios requiring consecutive write operations (e.g., modifying structure then writing data). Only for Lark Sheets.
Lark Sheet ChartManage charts in Lark Sheets (column, line, pie, bar, area, scatter, combo, radar, etc.). Use when users need to create charts, modify chart styles or data sources, view existing chart configurations, or delete charts. Also applicable for data visualization scenarios like "data visualization," "draw a chart," "trend analysis," "comparison chart," "proportion analysis," etc. Only for Lark Sheets.
Lark Sheet Pivot TableManage pivot tables in Lark Sheets. Use when users need to create pivot tables, modify row/column fields/aggregation methods/filter conditions, view existing pivot table configurations, or delete pivot tables. Also applicable for scenarios like "group summary," "cross-analysis," "count by XXX," "group by field," "sub-group," "multi-dimensional analysis," "pivot data," etc. Only for Lark Sheets.
Lark Sheet Conditional FormatManage conditional formatting rules in Lark Sheets (duplicate value highlighting, cell value comparison, data bars, color scales, ranking, custom formulas, etc.). Use when users need to create conditional formatting, modify the range or style of existing rules, view current configurations, or delete rules. Also applicable for scenarios like "highlight," "mark red," "color tag," "data bar," "color scale," "conditional style," etc. Only for Lark Sheets.
Lark Sheet FilterManage filters in Lark Sheets. Use when users need to filter data (filter rows by text/numeric/color/date conditions), view existing filter configurations, or modify/delete filters. Also applicable for scenarios like "only show," "filter out," "keep only those meeting conditions," etc. Only for Lark Sheets.
Lark Sheet Filter ViewManage filter views in Lark Sheets. Use when users need to "create an XX view," "save this filter state," "switch between different filters," or maintain multiple independent filter configurations on one sheet. Views and filters are independent and can coexist on the same sheet. Hidden rows in a view only take effect locally when the user enters that view and do not affect other collaborators. Only for Lark Sheets.
Lark Sheet SparklineManage sparklines in Lark Sheets (line, column, win/loss). Use when users need to embed small charts within cells to display data trends. Also applicable for "trend line," "in-cell chart," "sparkline," etc. Note: Not the same as the disabled SPARKLINE() formula function. Only for Lark Sheets.
Lark Sheet Float ImageManage floating images in Lark Sheets. Use when users need to insert floating images, adjust image position and size, view existing floating images, or delete images. Also applicable for "insert image," "add logo," "put an image here," etc. Note: If the user needs to embed an image inside a specific cell (cell image), read lark-sheets-write-cells. Only for Lark Sheets.

Common Flag Quick Reference

Each shortcut in the references is marked with a line of badges indicating the common/system flags it supports, for example:

  • _Common Four-Piece Set · System: --dry-run_, URL/token + sheet positioning (one of each group must be provided, see "Common Flags" below), plus --dry-run
  • _Common: URL/token (no sheet positioning) · System: --yes, --dry-run_, Accepts only URL/token, common for shortcuts like +batch-update that do not require sheet positioning.

Only names are listed in the badges. Types / requirements / descriptions are declared uniformly in this section:

Common Flags (Resource Positioning)

Common Four-Piece Set = --url / --spreadsheet-token / --sheet-id / --sheet-name, divided into two XOR groups. One of each group must be provided (XOR = one of two is mandatory, not "optional"):

  1. Spreadsheet positioning (mandatory): Choose one of --url or --spreadsheet-token. One must be provided. If neither is provided → validation error specify at least one of --url or --spreadsheet-token; if both are provided → mutual conflict.
    • --url only parses links containing /sheets/ and /spreadsheets/ (extracts the token from the path; you can also pass the raw token directly to --spreadsheet-token). Other link formats will not be parsed as spreadsheet tokens.
    • ⚠️ /wiki/ knowledge base links cannot be used directly as spreadsheet positioning: A wiki link might point to a spreadsheet, a document, or a base. --url will not automatically parse a wiki token into a spreadsheet token; passing it directly will fail. You must first resolve it into a real document token, lark-cli wiki +node-get --node-token "<wiki link or token>" and, after confirming the returned obj_type is sheet, use its obj_token as the --spreadsheet-token (see ../lark-wiki/SKILL.md for parsing details).
    • Exception: +workbook-create creates a new table that does not yet exist and does not accept any spreadsheet / sheet positioning flags (only --title / --folder-token / --headers / --values).
  2. Sheet positioning (mandatory for Common Four-Piece Set shortcuts): Choose one of --sheet-id or --sheet-name. One must be provided. If neither is provided → validation error specify at least one of --sheet-id or --sheet-name.
    • ⚠️ Do not guess Sheet1 if the sheet name is uncertain: Unless the user explicitly states the sheet name/id, or the context (previous tool calls / URL anchor ?sheet=xxx) has already provided a specific value, the first step is to call +workbook-info --url "..." (or --spreadsheet-token) to get the sheets[].sheet_id / sheets[].title list and then select. In Chinese environments, sub-sheets are often named "Data" / "Sheet" (no number) / "Worksheet 1" / business names. Guessing Sheet1 will likely hit sheet not found, costing an extra failed call + retry.
    • ⚠️ The Sheet1! prefix in --range cannot replace sheet positioning: Even if you write --range 'Sheet1!A1:B2', you must still pass --sheet-id or --sheet-name, otherwise the same error will occur.
    • ⚠️ A1 references containing ! (--source / --range / --ranges): Start the shell session with set +H to disable bash history expansion, otherwise "Sheet1!A1" will be blocked as event not found. Sheet names containing special characters (- / spaces / non-ASCII) must be wrapped in single quotes internally, e.g., --source "'Sales-2025'!A1:D100".
    • Exception: Shortcuts marked _Common: URL/token (no sheet positioning) ..._ (e.g., +workbook-info / +workbook-export / +batch-update / +dropdown-update|delete / +cells-batch-set-style / +cells-batch-clear / +sheet-create) do not accept or require sheet positioning; just provide one set of spreadsheet positioning. +pivot-create uses --target-sheet-id / --target-sheet-name (XOR, both can be omitted; see lark-sheets-pivot-table for landing details).
FlagTypeMandatoryDescription
--urlstringOne of two (with --spreadsheet-token)spreadsheet URL
--spreadsheet-tokenstringOne of two (with --url)spreadsheet token
--sheet-idstringOne of two (with --sheet-name; Common Four-Piece Set only)sheet reference_id
--sheet-namestringOne of two (with --sheet-id; Common Four-Piece Set only)sheet name

Unified Calling Paradigm (all examples for Common Four-Piece Set shortcuts follow this shape, both positioning groups are indispensable):

lark-cli sheets <shortcut> <workbook positioning> <sheet positioning> <other flags>
#   workbook positioning: --url "..."        or --spreadsheet-token "..."           (choose one, mandatory)
#   sheet positioning:    --sheet-id "$SID"  or --sheet-name "<real sheet name>"    (choose one, mandatory; do not use placeholders)
# Example: lark-cli sheets +csv-get --url "https://.../sheets/shtXXX" --sheet-name "<real sheet name>" --range "A1:F30"
# Note: Do not guess "Sheet1" as the real sheet name, most tables do not use this; first use +workbook-info to get sheets[].title then substitute.

System Flags

FlagTypeMandatoryDescription
--dry-runboolNoZero side effects: only prints request path and parameter template, does not initiate calls; multi-step operations will output request templates for each sub-operation.
--yesboolYes (only high-risk-write)Secondary confirmation; exits with code 10 if not provided. See ../lark-shared/SKILL.md for high-risk approval protocols.
--print-schemaboolNoPrints the JSON Schema of a composite JSON flag locally and exits, without initiating any calls or requiring other mandatory flags. Use with --flag-name <name> to specify which flag to query; if --flag-name is omitted, lists all queryable flags for that shortcut. Only valid if the shortcut contains composite JSON flags, how to judge: if a flag marked as "Composite JSON" (e.g., --cells / --properties / --operations / --border-styles / --sort-keys / --options) appears in the Flags table, it is supported; shortcuts with only scalar flags do not support this.
--flag-namestringNoUsed with --print-schema to specify the flag name (without -- prefix, e.g., cells / properties / operations) for which to print the JSON Schema.

Agent Usage Tip: When writing composite JSON flags (--cells / --properties / --operations / --border-styles / --sort-keys / --options, etc.), if you are unsure of the structure, first run lark-cli sheets <shortcut> --print-schema --flag-name <name> to read the complete JSON Schema before constructing the payload. This is more accurate than relying on reference quick-reference tables and avoids rejection by the server due to spelling errors or missing fields. The ## Schemas section of the reference only provides a single-layer structure; for deep structures, rely on --print-schema or real examples in ## Examples.

Flag Content Types and Output Conventions (Terminology)

  • JSON-class inputs in the flag table are marked in three categories: Composite JSON = deeply nested objects (use --print-schema to get the full structure); Simple JSON = 1D/2D scalar arrays (e.g., ["sheet1!A1:B2",...] / [["alice",95]], simple structure, no print-schema needed); Non-JSON Text = raw text (e.g., CSV). --print-schema is only valid for Composite JSON flags (simple JSON flags of the same shortcut, like --colors, are not included).
  • envelope: All shortcuts return a unified outer structure {ok, identity, data, ...}. In the body, envelope.data refers to the business data layer (e.g., annotated_csv for +csv-get); write operations do not automatically read back. If verification is needed, call the corresponding +*-list / +*-get / +cells-get yourself.

Composite JSON / Large Inputs: Prefer Stdin

For inputs marked as supporting Stdin in the flag help, if the payload is large, contains special characters like newlines/quotes, or is already in a file, prefer using stdin (-) to avoid command line length limits and shell escaping issues.

Recommended approach: Write the payload to a temporary file outside the user's project directory (use the system temporary directory to avoid polluting the project), then feed it in via stdin:

# TMPFILE points to a payload file in the system temporary directory (use tempfile.gettempdir() / os.tmpdir() in scripts to get the temp directory)
lark-cli sheets +cells-set --url "..." --sheet-name "Sheet1" --range "A1:B2" --cells - < "$TMPFILE"

@file with an absolute path will be rejected, and do not follow the error prompt after rejection. For security reasons, @file only accepts relative paths under the cwd; passing an absolute path outside the cwd will be rejected. The error message will suggest "cd to the target directory or use a relative path", do not follow either: cd-ing or writing temporary files into the user's project directory will pollute the working directory. The correct solution is to use stdin (--<flag> - < file).

Share:
Details:
  • Installs


    201,669
  • First seen


    Jun 10, 2026
View Repository

Auto-fetched from GitHub .

Stats via skills.sh.

Skills similar to lark-sheets:

 

 
 
  • Installs


 

 
 
  • Installs


 

 
 
  • Installs