{"record":{"id":"7eb6e1fb2fc524f9","repo":"larksuite/cli","slug":"args-field-s-flag-q-is-not-a-canonical-flag-nam","errorCode":null,"errorMessage":"Args field %s: flag %q is not a canonical flag name","messagePattern":"Args field (.+?): flag %q is not a canonical flag name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_compile_args.go","lineNumber":131,"sourceCode":"\t\t\t\tif inlineType.Kind() == reflect.Pointer {\n\t\t\t\t\treturn fmt.Errorf(\"Args field %s: arg:\\\"inline\\\" must be a struct value, not pointer\", field.Name)\n\t\t\t\t}\n\t\t\t\tif inlineType.Kind() != reflect.Struct {\n\t\t\t\t\treturn fmt.Errorf(\"Args field %s: arg:\\\"inline\\\" must be a struct, got %s\", field.Name, field.Type)\n\t\t\t\t}\n\t\t\t\tif hasAnyTag(field, \"flag\", \"schema\", \"cli\", \"doc\", \"json\") {\n\t\t\t\t\treturn fmt.Errorf(\"Args field %s: arg:\\\"inline\\\" cannot declare public input tags\", field.Name)\n\t\t\t\t}\n\t\t\t\tif err := collectArgFields(inlineType, index, true, out, seenGo, supplements); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"Args field %s: unknown arg mode %q\", field.Name, argMode)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif !flagNamePattern.MatchString(flagName) {\n\t\t\treturn fmt.Errorf(\"Args field %s: flag %q is not a canonical flag name\", field.Name, flagName)\n\t\t}\n\t\tif hasAnyTag(field, \"json\") {\n\t\t\treturn fmt.Errorf(\"Args field %s (--%s): json tag is not allowed on a CLI field\", field.Name, flagName)\n\t\t}\n\t\tvalueType, valueIndex, isProvided, err := unwrapProvided(field.Type)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Args field %s (--%s): %w\", field.Name, flagName, err)\n\t\t}\n\t\tschema, err := parseSchemaTag(field.Tag.Get(\"schema\"), valueType, true)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Args field %s (--%s): %w\", field.Name, flagName, err)\n\t\t}\n\t\tcli, err := parseCLITag(field.Tag.Get(\"cli\"))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Args field %s (--%s): %w\", field.Name, flagName, err)\n\t\t}\n\t\tvar shape typedValueShape\n\t\tsupplement, hasSupplement := supplements[flagName]","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_compile_args.go#L113-L149","documentation":"A `flag` struct tag's name fails the canonical-flag-name rule enforced during collectArgFields; the flag would otherwise be mounted with an invalid CLI spelling.","triggerScenarios":"Thrown at shortcuts/common/typed_compile_args.go:131 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the flag to canonical kebab-case in the tag"],"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"}