{"record":{"id":"05ab45caa7162ab0","repo":"larksuite/cli","slug":"invalid-requiredcliversion-q-unknown-operator-q","errorCode":null,"errorMessage":"invalid RequiredCLIVersion %q: unknown operator %q","messagePattern":"invalid RequiredCLIVersion %q: unknown operator %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/platform/version.go","lineNumber":87,"sourceCode":"\tif err != nil {\n\t\t// Build version is unparseable -- treat as DEV so an exotic\n\t\t// build tag doesn't lock plugins out.\n\t\treturn true, nil //nolint:nilerr // intentional fail-open for unparseable buildVersion\n\t}\n\tcmp := compareSemver(bv, rv)\n\tswitch op {\n\tcase \"=\", \"\":\n\t\treturn cmp == 0, nil\n\tcase \">=\":\n\t\treturn cmp >= 0, nil\n\tcase \">\":\n\t\treturn cmp > 0, nil\n\tcase \"<=\":\n\t\treturn cmp <= 0, nil\n\tcase \"<\":\n\t\treturn cmp < 0, nil\n\tdefault:\n\t\treturn false, fmt.Errorf(\"invalid RequiredCLIVersion %q: unknown operator %q\", constraint, op)\n\t}\n}\n\n// splitConstraint extracts the leading comparator (if any) from a\n// constraint string. The operator is one of \"\", \"=\", \">=\", \">\", \"<=\", \"<\".\nfunc splitConstraint(s string) (op, rest string) {\n\tswitch {\n\tcase strings.HasPrefix(s, \">=\"):\n\t\treturn \">=\", strings.TrimSpace(s[2:])\n\tcase strings.HasPrefix(s, \"<=\"):\n\t\treturn \"<=\", strings.TrimSpace(s[2:])\n\tcase strings.HasPrefix(s, \">\"):\n\t\treturn \">\", strings.TrimSpace(s[1:])\n\tcase strings.HasPrefix(s, \"<\"):\n\t\treturn \"<\", strings.TrimSpace(s[1:])\n\tcase strings.HasPrefix(s, \"=\"):\n\t\treturn \"=\", strings.TrimSpace(s[1:])\n\tdefault:","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/platform/version.go#L69-L105","documentation":"After parsing the constraint's versions, satisfiesRequiredCLIVersion compares using the extracted operator; an operator outside {\"\", \"=\", \">=\", \">\", \"<=\", \"<\"} hits the default branch and returns this error naming the unsupported operator. splitConstraint only extracts a leading comparator, so this indicates a constraint grammar violation.","triggerScenarios":"A plugin manifest's RequiredCLIVersion uses an operator the checker doesn't support — e.g. \"~1.2\", \"^2.0\", \"!=1.0\", \"==1.0\" — or a constraint string where the extracted leading token isn't a recognized comparator.","commonSituations":"Plugin authors copying range syntax from npm/semver/cargo ecosystems; typos like \"=>1.2\" or \"=<1.2\"; legacy manifests written against a different constraint grammar.","solutions":["Rewrite the constraint using a supported operator: =, >=, >, <=, <, or empty for exact-ish match.","Replace \"^1.2\" with \">=1.2\" (or the precise range you need, noting only a single comparator is supported).","Fix typos: \"=>1.2\" → \">=1.2\", \"=<1.2\" → \"<=1.2\".","Regenerate/upgrade the plugin manifest from the plugin tooling that emits supported constraints."],"exampleFix":"// before\n\"RequiredCLIVersion\": \"^1.2\"\n// after\n\"RequiredCLIVersion\": \">=1.2\"","handlingStrategy":"validation","validationCode":"supported := map[string]bool{\"\": true, \"=\": true, \">=\": true, \">\": true, \"<=\": true, \"<\": true}\nop, _ := splitConstraint(c)\nif !supported[op] {\n    return fmt.Errorf(\"unsupported operator %q in RequiredCLIVersion\", op)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict manifests to =, >=, >, <=, <, or empty operators","Never copy ^/~ range syntax from npm/semver tooling","Lint plugin manifests for constraint grammar before publishing"],"tags":["plugins","versioning","validation","manifest"],"backgroundTag":"invalid-version-constraint","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"}