kovidgoyal/kitty · error
cannot use --human-name or --password in filter mode
Error message
cannot use --human-name or --password in filter mode
What it means
In filter mode (kitten clipboard with no file arguments, which pipes stdin through the clipboard via run_plain_text_loop), no authentication context is allowed. If --password or --human-name was supplied anyway, clipboard_main rejects the combination before starting the loop.
Source
Thrown at kittens/clipboard/main.go:67
opts.Password = strings.TrimRightFunc(string(data), unicode.IsSpace)
}
} else {
return 1, fmt.Errorf("not a valid file descriptor number: %#v", val)
}
case "file":
if data, err := os.ReadFile(val); err == nil {
opts.Password = strings.TrimRightFunc(string(data), unicode.IsSpace)
} else {
return 1, fmt.Errorf("failed to read from file: %#v with error: %w", val, err)
}
}
}
if len(args) > 0 {
return 0, run_mime_loop(opts, args)
}
if opts.Password != "" || opts.HumanName != "" {
return 1, fmt.Errorf("cannot use --human-name or --password in filter mode")
}
return 0, run_plain_text_loop(opts)
}
func EntryPoint(parent *cli.Command) {
create_cmd(parent, clipboard_main)
}
View on GitHub (pinned to 6d5d0c4406)
Solutions
- For simple piping, drop --password/--human-name: `echo hi | kitten clipboard`
- To use passwords, run an explicit get/getfile command with file arguments, e.g. `kitten clipboard get --human-name me --password text:pw dest.png`
- Review kitten clipboard --help to confirm which mode your flags apply to
Example fix
# before echo hi | kitten clipboard --human-name me --password text:pw # after echo hi | kitten clipboard
Defensive patterns
Strategy: validation
Validate before calling
# filter mode = no positional args; forbid auth flags then
[ $# -eq 0 ] && { [ -n "$PW$HUMAN" ] && { echo 'no --password/--human-name in filter mode'; exit 2; }; } Prevention
- Branch your wrapper: filter mode vs get/getfile mode, and only add auth flags in the latter
When it happens
Trigger: Running `kitten clipboard --human-name x` or `kitten clipboard --password text:y` (or both) with zero positional file arguments — that is, plain filter mode reading stdin.
Common situations: Users adding password flags to a pipeline like `echo hi | kitten clipboard --password text:pw` expecting password-protected copying; flag-order confusion where get/set subcommands were omitted.
Related errors
- must specify --human-name when using a password
- invalid password: %#v no password type specified
- not a valid file descriptor number: %#v
- %s is not valid MIME alias specification
- Too much piped data
AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27).
Data as JSON: /api/errors/c865fefbc98d4ee5.
Report an issue: GitHub.