{"record":{"id":"5d4c374b49aee0ce","repo":"larksuite/cli","slug":"metadata-command-q-must-start-with","errorCode":null,"errorMessage":"Metadata.Command %q must start with '+'","messagePattern":"Metadata\\.Command %q must start with '\\+'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_compiler.go","lineNumber":104,"sourceCode":"}\n\nfunc validateCommandMetadata(metadata typedCommandMetadata) error {\n\tservice := strings.TrimSpace(string(metadata.Service))\n\tif service == \"\" {\n\t\treturn fmt.Errorf(\"Metadata.Service is required\")\n\t}\n\tif service != string(metadata.Service) || strings.ContainsAny(service, \" \\t\\r\\n/\") {\n\t\treturn fmt.Errorf(\"Metadata.Service %q must be one trimmed command segment\", metadata.Service)\n\t}\n\tcommand := strings.TrimSpace(metadata.Command)\n\tif command == \"\" {\n\t\treturn fmt.Errorf(\"Metadata.Command is required\")\n\t}\n\tif command != metadata.Command || strings.ContainsAny(command, \" \\t\\r\\n/\") {\n\t\treturn fmt.Errorf(\"Metadata.Command %q must be one trimmed command segment\", metadata.Command)\n\t}\n\tif !strings.HasPrefix(command, \"+\") {\n\t\treturn fmt.Errorf(\"Metadata.Command %q must start with '+'\", metadata.Command)\n\t}\n\tif command == \"+\" {\n\t\treturn fmt.Errorf(\"Metadata.Command must contain a name after '+'\")\n\t}\n\tif strings.TrimSpace(metadata.Description) == \"\" {\n\t\treturn fmt.Errorf(\"Metadata.Description is required\")\n\t}\n\tswitch metadata.Risk {\n\tcase typedRiskRead, typedRiskWrite, typedRiskHighRiskWrite:\n\tdefault:\n\t\treturn fmt.Errorf(\"Metadata.Risk %q is invalid\", metadata.Risk)\n\t}\n\tif len(metadata.Authorization.Identities) == 0 {\n\t\treturn fmt.Errorf(\"Metadata.Authorization.Identities must declare at least one identity\")\n\t}\n\tfor identity, auth := range metadata.Authorization.Identities {\n\t\tif identity != typedIdentityUser && identity != typedIdentityBot {\n\t\t\treturn fmt.Errorf(\"Metadata.Authorization identity %q is invalid\", identity)","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_compiler.go#L86-L122","documentation":"Compile-time guard in validateCommandMetadata: Metadata.Command must begin with '+' to denote a shortcut command path.","triggerScenarios":"Thrown at shortcuts/common/typed_compiler.go:104 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Prefix the command name with '+'"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}