Skip to content

Commit 57212ea

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

136 files changed

Lines changed: 309 additions & 5334 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_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_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_delete.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ 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{baseHighRiskYesTip},
2526
DryRun: func(ctx context.Context, runtime *common.RuntimeContext) *common.DryRunAPI {
2627
return common.NewDryRunAPI().
2728
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ 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{baseHighRiskYesTip},
2829
DryRun: func(ctx context.Context, runtime *common.RuntimeContext) *common.DryRunAPI {
2930
return common.NewDryRunAPI().
3031
DELETE("/open-apis/base/v3/bases/:base_token/tables/:table_id/forms/:form_id/questions").

shortcuts/base/base_role_create.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ var BaseRoleCreate = common.Shortcut{
2727
{Name: "base-token", Desc: "base token", Required: true},
2828
{Name: "json", Desc: `body JSON (AdvPermBaseRoleConfig), e.g. {"role_name":"Reviewer","role_type":"custom_role","table_rule_map":{...}}`, Required: true},
2929
},
30+
Tips: []string{
31+
`Example: --json '{"role_name":"Reviewer","role_type":"custom_role","base_rule_map":{"copy":false,"download":false}}'`,
32+
"Read role-config.md for table_rule_map, dashboard_rule_map, docx_rule_map, and filter permission JSON.",
33+
"Create supports custom_role only.",
34+
},
3035
Validate: func(ctx context.Context, runtime *common.RuntimeContext) error {
3136
if strings.TrimSpace(runtime.Str("base-token")) == "" {
3237
return common.FlagErrorf("--base-token must not be blank")

shortcuts/base/base_role_delete.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ var BaseRoleDelete = common.Shortcut{
2626
{Name: "base-token", Desc: "base token", Required: true},
2727
{Name: "role-id", Desc: "role ID (e.g. rolxxxxxx4)", Required: true},
2828
},
29+
Tips: []string{
30+
baseHighRiskYesTip,
31+
"Only custom roles can be deleted; system roles cannot be deleted.",
32+
"Use +role-get first if the role target is ambiguous, then pass --yes to confirm deletion.",
33+
},
2934
Validate: func(ctx context.Context, runtime *common.RuntimeContext) error {
3035
if strings.TrimSpace(runtime.Str("base-token")) == "" {
3136
return common.FlagErrorf("--base-token must not be blank")

shortcuts/base/base_role_get.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ var BaseRoleGet = common.Shortcut{
2727
{Name: "base-token", Desc: "base token", Required: true},
2828
{Name: "role-id", Desc: "role ID (e.g. rolxxxxxx4)", Required: true},
2929
},
30+
Tips: []string{
31+
`Example: lark-cli base +role-get --base-token <base_token> --role-id <role_id>`,
32+
"Use before +role-update to inspect the current full permission config.",
33+
},
3034
Validate: func(ctx context.Context, runtime *common.RuntimeContext) error {
3135
if strings.TrimSpace(runtime.Str("base-token")) == "" {
3236
return common.FlagErrorf("--base-token must not be blank")

0 commit comments

Comments
 (0)