larksuite / larksuite/cli

[Base] Add typed Field Groups shortcut

Open
#2,157 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug domain/base
Dominant language
Go
Stars
17.3k
Forks
1.4k
Avg merge
2d 4h
Merged PRs (30d)
105

Description

Summary

Add a typed Base shortcut for creating Field Groups (column groups in the Base UI). This is distinct from record grouping through +view-set-group.

Environment

  • lark-cli: 1.0.81
  • Brand: Lark
  • Identity tested: user

Current behavior

lark-cli base --help exposes field CRUD and view grouping, but no +field-group-* shortcut. Agents must use the raw API escape hatch:

lark-cli api POST /open-apis/bitable/v1/apps/<app_token>/tables/<table_id>/field_groups \
  --as user \
  --data @field-groups.json

The endpoint works when the token has base:field_group:create. It is also represented by AppTableFieldGroup.Create in the official Go SDK.

Proposed behavior

Provide a typed shortcut such as:

lark-cli base +field-group-create \
  --base-token <app_token> \
  --table-id <table_id> \
  --json @field-groups.json \
  --as user \
  --dry-run

The shortcut should:

  • Declare and check base:field_group:create.
  • Validate the top-level field_groups array and non-empty children.
  • Explain that each field can belong to only one Field Group.
  • Surface error 1254122 as an existing/duplicate group membership conflict.
  • Clearly distinguish Field Groups from +view-set-group.
  • Return the created field_groups[].id, name, and description.

If the platform only exposes create today, the CLI should not invent unsupported list/update/delete operations.

References

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing Base field CRUD shortcuts and their help and validation patterns, then compare the official Go SDK Field Group sample with the documented POST endpoint. Add only the typed create shortcut, including permission and payload checks, duplicate-membership error handling, distinction from +view-set-group, and created field-group output. Done when the proposed dry-run command and relevant help behavior work without inventing unsupported operations.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.