Skip to content

Commit a618b19

Browse files
committed
docs: optimize base skill references
1 parent 0e6274d commit a618b19

149 files changed

Lines changed: 628 additions & 5309 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

shortcuts/base/base_advperm_disable.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ var BaseAdvpermDisable = common.Shortcut{
2525
Flags: []common.Flag{
2626
{Name: "base-token", Desc: "base token", Required: true},
2727
},
28+
Tips: []string{
29+
baseHighRiskYesTip,
30+
"Disabling advanced permissions invalidates existing custom roles; confirm the target Base before passing --yes.",
31+
},
2832
Validate: func(ctx context.Context, runtime *common.RuntimeContext) error {
2933
if strings.TrimSpace(runtime.Str("base-token")) == "" {
3034
return common.FlagErrorf("--base-token must not be blank")

shortcuts/base/base_advperm_enable.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ var BaseAdvpermEnable = common.Shortcut{
2525
Flags: []common.Flag{
2626
{Name: "base-token", Desc: "base token", Required: true},
2727
},
28+
Tips: []string{
29+
"Caller must be a Base admin; enable advanced permissions before creating or updating roles.",
30+
},
2831
Validate: func(ctx context.Context, runtime *common.RuntimeContext) error {
2932
if strings.TrimSpace(runtime.Str("base-token")) == "" {
3033
return common.FlagErrorf("--base-token must not be blank")

shortcuts/base/base_copy.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ var BaseBaseCopy = common.Shortcut{
2424
{Name: "without-content", Type: "bool", Desc: "copy structure only"},
2525
{Name: "time-zone", Desc: "time zone, e.g. Asia/Shanghai"},
2626
},
27+
Tips: []string{
28+
`Example: lark-cli base +base-copy --base-token <base_token> --name "Copy of Project Tracker"`,
29+
"Use --without-content when the user wants only structure.",
30+
"If copied as bot, output may include permission_grant; report it so the user knows whether they can open the new Base.",
31+
},
2732
DryRun: dryRunBaseCopy,
2833
Execute: func(ctx context.Context, runtime *common.RuntimeContext) error {
2934
return executeBaseCopy(runtime)

shortcuts/base/base_create.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ var BaseBaseCreate = common.Shortcut{
2222
{Name: "folder-token", Desc: "folder token for destination"},
2323
{Name: "time-zone", Desc: "time zone, e.g. Asia/Shanghai"},
2424
},
25+
Tips: []string{
26+
`Example: lark-cli base +base-create --name "Project Tracker" --time-zone Asia/Shanghai`,
27+
"If created as bot, output may include permission_grant; report it so the user knows whether they can open the new Base.",
28+
},
2529
DryRun: dryRunBaseCreate,
2630
Execute: func(ctx context.Context, runtime *common.RuntimeContext) error {
2731
return executeBaseCreate(runtime)

shortcuts/base/base_data_query.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ var BaseDataQuery = common.Shortcut{
2020
AuthTypes: authTypes(),
2121
Flags: []common.Flag{
2222
baseTokenFlag(true),
23-
{Name: "dsl", Desc: "query JSON DSL (LiteQuery Protocol)", Required: true},
23+
{Name: "dsl", Desc: "query JSON DSL; read lark-base-data-query-guide.md first, then lark-base-data-query.md for the full DSL SSOT", Required: true},
24+
},
25+
Tips: []string{
26+
"Use +data-query for server-side aggregation, grouping, filtering, sorting, and Top N queries.",
27+
"Read lark-base-data-query-guide.md for common fewshots; use lark-base-data-query.md only when the full DSL reference is needed.",
28+
"`dimensions` and `measures` cannot both be empty.",
2429
},
2530
Validate: func(ctx context.Context, runtime *common.RuntimeContext) error {
2631
var dsl map[string]interface{}

shortcuts/base/base_execute_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ func TestBaseObjectJSONShortcutsRejectArrayInDryRun(t *testing.T) {
515515
if !strings.Contains(err.Error(), "--json must be a JSON object") {
516516
t.Fatalf("err=%v", err)
517517
}
518-
if !strings.Contains(err.Error(), "lark-base skill") {
518+
if !strings.Contains(err.Error(), "match the documented shape") {
519519
t.Fatalf("err=%v", err)
520520
}
521521
if strings.Contains(err.Error(), "array") {

shortcuts/base/base_form_create.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ var BaseFormCreate = common.Shortcut{
2525
{Name: "name", Desc: "form name", Required: true},
2626
{Name: "description", Desc: `form description (plain text or markdown link like [text](https://example.com))`},
2727
},
28+
Tips: []string{
29+
"Record the returned form_id; form question create/list/update/delete commands need it.",
30+
},
2831
DryRun: func(ctx context.Context, runtime *common.RuntimeContext) *common.DryRunAPI {
2932
return common.NewDryRunAPI().
3033
POST("/open-apis/base/v3/bases/:base_token/tables/:table_id/forms").

shortcuts/base/base_form_delete.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ var BaseFormDelete = common.Shortcut{
2222
{Name: "table-id", Desc: "table ID", Required: true},
2323
{Name: "form-id", Desc: "form ID", Required: true},
2424
},
25+
Tips: []string{
26+
"Use +form-list or +form-get first when the form target is ambiguous.",
27+
baseHighRiskYesTip,
28+
},
2529
DryRun: func(ctx context.Context, runtime *common.RuntimeContext) *common.DryRunAPI {
2630
return common.NewDryRunAPI().
2731
DELETE("/open-apis/base/v3/bases/:base_token/tables/:table_id/forms/:form_id").

shortcuts/base/base_form_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var BaseFormsList = common.Shortcut{
2323
Flags: []common.Flag{
2424
{Name: "base-token", Desc: "Base token (base_token)", Required: true},
2525
{Name: "table-id", Desc: "table ID", Required: true},
26-
{Name: "page-size", Type: "int", Default: "100", Desc: "page size per request (max 100)"},
26+
{Name: "page-size", Type: "int", Default: "100", Desc: "page size per request, max 100"},
2727
},
2828
DryRun: func(ctx context.Context, runtime *common.RuntimeContext) *common.DryRunAPI {
2929
return common.NewDryRunAPI().

shortcuts/base/base_form_questions_delete.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ var BaseFormQuestionsDelete = common.Shortcut{
2525
{Name: "form-id", Desc: "form ID", Required: true},
2626
{Name: "question-ids", Desc: `JSON array of question IDs to delete, max 10 items, e.g. '["q_001","q_002"]'`, Required: true},
2727
},
28+
Tips: []string{
29+
`Example: --question-ids '["q_001","q_002"]'`,
30+
baseHighRiskYesTip,
31+
},
2832
DryRun: func(ctx context.Context, runtime *common.RuntimeContext) *common.DryRunAPI {
2933
return common.NewDryRunAPI().
3034
DELETE("/open-apis/base/v3/bases/:base_token/tables/:table_id/forms/:form_id/questions").

0 commit comments

Comments
 (0)