{"record":{"id":"27f2835dd7117391","repo":"larksuite/cli","slug":"typed-shortcut-s-s-v","errorCode":null,"errorMessage":"typed shortcut %s %s: %v","messagePattern":"typed shortcut (.+?) (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/runner.go","lineNumber":929,"sourceCode":"\n// Mount registers the shortcut on a parent command.\nfunc (s Shortcut) Mount(parent *cobra.Command, f *cmdutil.Factory) {\n\ts.MountWithContext(context.Background(), parent, f)\n}\n\n// MountWithContext registers a shortcut while preserving the caller-provided context.\nfunc (s Shortcut) MountWithContext(ctx context.Context, parent *cobra.Command, f *cmdutil.Factory) {\n\tif s.Execute != nil || s.typed != nil {\n\t\ts.mountDeclarative(ctx, parent, f)\n\t}\n}\n\n// mountDeclarative builds and registers the Cobra command described by a Shortcut.\nfunc (s Shortcut) mountDeclarative(ctx context.Context, parent *cobra.Command, f *cmdutil.Factory) {\n\tshortcut := s\n\tif shortcut.typed != nil {\n\t\tif err := validateTypedFlagMountPlan(shortcut.typed, shortcut.PrintFlagSchema != nil, typedRisk(shortcut.Risk)); err != nil {\n\t\t\tpanic(fmt.Sprintf(\"typed shortcut %s %s: %v\", shortcut.Service, shortcut.Command, err))\n\t\t}\n\t}\n\tif len(shortcut.AuthTypes) == 0 {\n\t\tshortcut.AuthTypes = []string{\"user\"}\n\t}\n\tbotOnly := len(shortcut.AuthTypes) == 1 && shortcut.AuthTypes[0] == \"bot\"\n\n\tcmd := &cobra.Command{\n\t\tUse:    shortcut.Command,\n\t\tShort:  shortcut.Description,\n\t\tHidden: shortcut.Hidden,\n\t\tArgs:   rejectPositionalArgs(),\n\t\tRunE: func(cmd *cobra.Command, _ []string) error {\n\t\t\tif handled, err := runShortcutFlagSchema(cmd, f, &shortcut); handled {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif shortcut.typed != nil {\n\t\t\t\treturn runTypedMountedShortcut(cmd, f, &shortcut, botOnly)","sourceCodeStart":911,"sourceCodeEnd":947,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/runner.go#L911-L947","documentation":"mountDeclarative panics when compiling a typed shortcut definition fails (the %v is the compile error): like other build-time data contracts, a broken shortcut must fail loudly at mount rather than register a malformed command.","triggerScenarios":"Thrown at shortcuts/common/runner.go:929 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the shortcut definition per the wrapped compile error and rebuild"],"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"}