diff --git a/cmd/root.go b/cmd/root.go index e86ff069..31a97728 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -49,18 +49,8 @@ EXAMPLES: lark-cli api GET /open-apis/calendar/v4/calendars FLAGS: - --params URL/query parameters JSON - --data request body JSON (POST/PATCH/PUT/DELETE) - --as identity type: user | bot - --format output format: json (default) | ndjson | table | csv | pretty - --page-all automatically paginate through all pages - --page-size page size (0 = use API default) - --page-limit max pages to fetch with --page-all (default: 10, 0 for unlimited) - --page-delay delay in ms between pages (default: 200, only with --page-all) - -o, --output output file path for binary responses - --jq jq expression to filter JSON output - -q shorthand for --jq - --dry-run print request without executing + e.g. --as, --format, -q/--jq, --dry-run ... + Run lark-cli --help for the full list. AI AGENT SKILLS: lark-cli pairs with AI agent skills (Claude Code, etc.) that diff --git a/cmd/root_test.go b/cmd/root_test.go index 3ab78ceb..ff1e3837 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -83,6 +83,17 @@ func TestRootLong_AgentSkillsLinkTargetsReadmeSection(t *testing.T) { } } +func TestRootLong_FlagsSectionPointsToCommandHelp(t *testing.T) { + // The flags shown in root help live on leaf commands (api, service), not + // on the root command — every one errors "unknown flag" at the top level. + // So the FLAGS section may only list them as examples and must route to + // ` --help` for the full set, rather than re-list them as if they + // were global root flags (which both lies and drifts as flags change). + if !strings.Contains(rootLong, "lark-cli --help") { + t.Fatalf("root help FLAGS section must point to `lark-cli --help` for the flag list, got:\n%s", rootLong) + } +} + func TestConfigureFlagCompletions(t *testing.T) { t.Cleanup(func() { cmdutil.SetFlagCompletionsEnabled(false) })