Skip to content

fix(base): unify --json help format with tips and agent hints#372

Merged
kongenpei merged 4 commits intomainfrom
fix-table-help
Apr 9, 2026
Merged

fix(base): unify --json help format with tips and agent hints#372
kongenpei merged 4 commits intomainfrom
fix-table-help

Conversation

@kongenpei
Copy link
Copy Markdown
Collaborator

@kongenpei kongenpei commented Apr 9, 2026

Summary

Standardize Base shortcut --json help output so it is easier for humans and agents to consume:

  • keep Flag.Desc short and explicit
  • move usage examples and guide pointers into Shortcut.Tips

Also keep +view-set-group guide aligned with object-style payload (group_config) only.

Changes

  • Updated 9 Base shortcuts to use a consistent help pattern:
    • Desc: concise JSON type description only
    • Tips[0]: Example: --json '...'
    • Tips[1]: Agent hint: use the lark-base skill's ... guide for usage and limits.
  • Commands covered:
    • +field-create, +field-update, +record-upsert
    • +view-create, +view-set-card, +view-set-filter
    • +view-set-group, +view-set-sort, +view-set-timebar
  • Updated skills/lark-base/references/lark-base-view-set-group.md to use object payload examples and removed direct-array wording.

Test Plan

  • go test ./shortcuts/base -run 'Test(Base|runShortcut|workflow)'
  • Manual local command verification

Related Issues

  • None

Summary by CodeRabbit

  • Documentation
    • Enhanced help text across multiple Lark Base commands by adding concrete --json examples and usage hints pointing to the relevant lark-base guides.
    • Clarified JSON input format for group-related operations: now documented as a required JSON object (wrapping group_config) instead of allowing a bare array.

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kongenpei has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 43e18e33-80d1-4c9f-b788-8bfe2055dc5f

📥 Commits

Reviewing files that changed from the base of the PR and between 72becdf and 1d40188.

📒 Files selected for processing (2)
  • shortcuts/base/view_set_group.go
  • skills/lark-base/references/lark-base-view-set-group.md
✅ Files skipped from review due to trivial changes (1)
  • skills/lark-base/references/lark-base-view-set-group.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • shortcuts/base/view_set_group.go

📝 Walkthrough

Walkthrough

Added Tips entries with example --json payloads and agent hints to nine base shortcuts; updated the view-set-group reference doc to require a JSON object with group_config. No execution, validation, or flag-required semantics were changed.

Changes

Cohort / File(s) Summary
Shortcut Tips / metadata
shortcuts/base/field_create.go, shortcuts/base/field_update.go, shortcuts/base/record_upsert.go, shortcuts/base/view_create.go, shortcuts/base/view_set_card.go, shortcuts/base/view_set_filter.go, shortcuts/base/view_set_group.go, shortcuts/base/view_set_sort.go, shortcuts/base/view_set_timebar.go
Added Tips arrays with concrete --json example strings and agent hints referencing lark-base guides; one flag description tightened (view_set_group json Desc changed to “group JSON object”). No changes to validation, dry-run, execution, or flag requiredness.
Documentation
skills/lark-base/references/lark-base-view-set-group.md
Changed command example and JSON schema to require an object with group_config instead of allowing a top-level array; parameter text narrowed to “JSON object.”

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • zgz2048

Poem

🐇 I nibble tips in tiny bites,
Example JSON lights the nights.
A hop, a hint, a doc in view,
Shortcuts clearer — ready for you.
Happy hops — from CodeRabbit Inc. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: standardizing the --json help format across Base shortcuts with tips and agent hints.
Description check ✅ Passed The description comprehensively covers all required sections: it provides a clear summary of the motivation (standardizing help output), lists all changes with specific commands updated, and includes a completed test plan with verification steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-table-help

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added domain/base PR touches the base domain size/M Single-domain feat or fix with limited business impact labels Apr 9, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
skills/lark-base/references/lark-base-view-set-group.md (1)

56-60: ⚠️ Potential issue | 🟠 Major

JSON Schema now contradicts the new required object shape

The doc now teaches --json as an object with group_config, but the schema still declares a top-level array. Please update the schema to match the new contract.

🛠️ Proposed doc fix
-{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":100,"description":"Field id or name"},"desc":{"type":"boolean","default":false,"description":"define how to sort group headers"}},"required":["field"],"additionalProperties":false},"minItems":0,"maxItems":3,"$schema":"http://json-schema.org/draft-07/schema#"}
+{"type":"object","properties":{"group_config":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":100,"description":"Field id or name"},"desc":{"type":"boolean","default":false,"description":"define how to sort group headers"}},"required":["field"],"additionalProperties":false},"minItems":0,"maxItems":3}},"required":["group_config"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/lark-base/references/lark-base-view-set-group.md` around lines 56 -
60, The JSON Schema in this doc still defines a top-level array, but the
code/docs now expect a top-level object containing a group_config property (used
by the --json flag); update the schema to make the root an object with a
required "group_config" property whose value is the existing array schema (items
are the objects with "field" and optional "desc"), preserve additionalProperties
as appropriate and keep the $schema declaration—ensure "group_config" is
required and its schema carries the original minItems/maxItems and item
structure.
🧹 Nitpick comments (1)
shortcuts/base/view_set_group.go (1)

23-23: Align --json help text with object-only guidance.

At Line 23, the description still says group JSON object/array, which contradicts the object-style guidance ({"group_config":[...]}) this PR is aiming to enforce in user-facing docs. Keep backward-compatible parsing in code, but make the help text object-only for consistency.

Proposed wording update
-		{Name: "json", Desc: `group JSON object/array, e.g. {"group_config":[{"field":"fldStatus","desc":false}]}; read skills/lark-base/references/lark-base-view-set-group.md`, Required: true},
+		{Name: "json", Desc: `group JSON object, e.g. {"group_config":[{"field":"fldStatus","desc":false}]}; read skills/lark-base/references/lark-base-view-set-group.md`, Required: true},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shortcuts/base/view_set_group.go` at line 23, Update the help text for the
CLI flag with Name: "json" so it describes an object-only payload (not
"object/array"); change the Desc string to say "group JSON object, e.g.
{\"group_config\":[{\"field\":\"fldStatus\",\"desc\":false}]}; read
skills/lark-base/references/lark-base-view-set-group.md" while leaving parsing
logic unchanged elsewhere so backward-compatible array parsing still works.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@skills/lark-base/references/lark-base-view-set-group.md`:
- Around line 56-60: The JSON Schema in this doc still defines a top-level
array, but the code/docs now expect a top-level object containing a group_config
property (used by the --json flag); update the schema to make the root an object
with a required "group_config" property whose value is the existing array schema
(items are the objects with "field" and optional "desc"), preserve
additionalProperties as appropriate and keep the $schema declaration—ensure
"group_config" is required and its schema carries the original minItems/maxItems
and item structure.

---

Nitpick comments:
In `@shortcuts/base/view_set_group.go`:
- Line 23: Update the help text for the CLI flag with Name: "json" so it
describes an object-only payload (not "object/array"); change the Desc string to
say "group JSON object, e.g.
{\"group_config\":[{\"field\":\"fldStatus\",\"desc\":false}]}; read
skills/lark-base/references/lark-base-view-set-group.md" while leaving parsing
logic unchanged elsewhere so backward-compatible array parsing still works.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 66c54959-2734-4912-9943-b9f86532e7da

📥 Commits

Reviewing files that changed from the base of the PR and between 619ec8c and e393959.

📒 Files selected for processing (10)
  • shortcuts/base/field_create.go
  • shortcuts/base/field_update.go
  • shortcuts/base/record_upsert.go
  • shortcuts/base/view_create.go
  • shortcuts/base/view_set_card.go
  • shortcuts/base/view_set_filter.go
  • shortcuts/base/view_set_group.go
  • shortcuts/base/view_set_sort.go
  • shortcuts/base/view_set_timebar.go
  • skills/lark-base/references/lark-base-view-set-group.md

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@1d40188b9ca928d8973f60bff7af67aa13185e09

🧩 Skill update

npx skills add larksuite/cli#fix-table-help -y -g

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kongenpei has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@kongenpei kongenpei changed the title fix(base): improve --json help examples and group guide fix(base): unify --json help format with tips and agent hints Apr 9, 2026
@kongenpei kongenpei requested a review from zgz2048 April 9, 2026 12:58
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kongenpei has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kongenpei has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@kongenpei kongenpei merged commit b4a26b2 into main Apr 9, 2026
15 checks passed
@kongenpei kongenpei deleted the fix-table-help branch April 9, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/base PR touches the base domain size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants