larksuite/cli · error
invalid RequiredCLIVersion %q: unknown operator %q
Error message
invalid RequiredCLIVersion %q: unknown operator %q
What it means
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.
Source
Thrown at internal/platform/version.go:87
if err != nil {
// Build version is unparseable -- treat as DEV so an exotic
// build tag doesn't lock plugins out.
return true, nil //nolint:nilerr // intentional fail-open for unparseable buildVersion
}
cmp := compareSemver(bv, rv)
switch op {
case "=", "":
return cmp == 0, nil
case ">=":
return cmp >= 0, nil
case ">":
return cmp > 0, nil
case "<=":
return cmp <= 0, nil
case "<":
return cmp < 0, nil
default:
return false, fmt.Errorf("invalid RequiredCLIVersion %q: unknown operator %q", constraint, op)
}
}
// splitConstraint extracts the leading comparator (if any) from a
// constraint string. The operator is one of "", "=", ">=", ">", "<=", "<".
func splitConstraint(s string) (op, rest string) {
switch {
case strings.HasPrefix(s, ">="):
return ">=", strings.TrimSpace(s[2:])
case strings.HasPrefix(s, "<="):
return "<=", strings.TrimSpace(s[2:])
case strings.HasPrefix(s, ">"):
return ">", strings.TrimSpace(s[1:])
case strings.HasPrefix(s, "<"):
return "<", strings.TrimSpace(s[1:])
case strings.HasPrefix(s, "="):
return "=", strings.TrimSpace(s[1:])
default:View on GitHub (pinned to 7fd6ef3c07)
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.
Example fix
// before "RequiredCLIVersion": "^1.2" // after "RequiredCLIVersion": ">=1.2"
Defensive patterns
Strategy: validation
Validate before calling
supported := map[string]bool{"": true, "=": true, ">=": true, ">": true, "<=": true, "<": true}
op, _ := splitConstraint(c)
if !supported[op] {
return fmt.Errorf("unsupported operator %q in RequiredCLIVersion", op)
} Prevention
- Restrict manifests to =, >=, >, <=, <, or empty operators
- Never copy ^/~ range syntax from npm/semver tooling
- Lint plugin manifests for constraint grammar before publishing
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- invalid RequiredCLIVersion %q: %w
- plugin %q rule invalid: %w
- L1: _meta.envelope_version = %q, want "1.0"
- Invalid column: {column!r}
- Invalid column index: {index}
AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04).
Data as JSON: /api/errors/05ab45caa7162ab0.
Report an issue: GitHub.