kovidgoyal/kitty · error

Unknown --kitten option: %s

Error message

Unknown --kitten option: %s

What it means

The hyperlinked_grep kitten accepts --kitten hyperlink=... only; any other --kitten value (or a missing '=' key other than 'hyperlink') is rejected when parsing CLI args.

Source

Thrown at kittens/hyperlinked_grep/main.go:137

			} else {
				sanitized_args = append(sanitized_args, "--"+key, val)
			}
		}
		switch key {
		case "path-separator":
			if val != string(os.PathSeparator) {
				delegate_to_rg = true
			}
		case "context-separator":
			context_separator = val
		case "field-context-separator":
			field_context_separator = val
		case "field-match-separator":
			field_match_separator = val
		case "kitten":
			k, v, found := strings.Cut(val, "=")
			if !found || k != "hyperlink" {
				return fmt.Errorf("Unknown --kitten option: %s", val)
			}
			for x := range strings.SplitSeq(v, ",") {
				switch x {
				case "none":
					kitten_opts.context_lines = false
					kitten_opts.file_headers = false
					kitten_opts.matching_lines = false
				case "all":
					kitten_opts.context_lines = true
					kitten_opts.file_headers = true
					kitten_opts.matching_lines = true
				case "matching_lines":
					kitten_opts.matching_lines = true
				case "file_headers":
					kitten_opts.file_headers = true
				case "context_lines":
					kitten_opts.context_lines = true
				default:

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Use only --kitten hyperlink=<comma-list> (values: none, matching_lines, file_headers, context_lines)
  2. Check spelling: key must be exactly 'hyperlink' with an '='
  3. Remove the option if you don't need hyperlink customization

Example fix

# before
kitty +kitten hyperlinked_grep --kitten hyperlinks=matching_lines foo
# after
kitty +kitten hyperlinked_grep --kitten hyperlink=matching_lines foo
Defensive patterns

Strategy: validation

Validate before calling

k, v, ok := strings.Cut(val, "=")
if !ok || k != "hyperlink" { return fmt.Errorf("bad --kitten value") }

Prevention

When it happens

Trigger: Passing --kitten foo=bar or --kitten hyperlink without '=' — strings.Cut on '=' fails or key != 'hyperlink'.

Common situations: Copying a --kitten option from another kitten's docs; typos like --kitten hyperlinks=... or missing value.

Related errors


AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27). Data as JSON: /api/errors/edc659349d2faa0c. Report an issue: GitHub.