CLI command
jeden copy
Hand an exact payload to the operator's clipboard from outside an interactive session, or check it is still there.
Exact invocation#
jeden copy <text> | jeden copy - [--check] [--json]Inputs and options#
- Required: the text to copy as positional words, or a single
-to read the payload from standard input. - Optional:
--checkreads the clipboard and says whether it still holds the payload, writing nothing.--jsonreturns the copied byte count and the writer that accepted the payload, or, with--check,holds, the reader and both sizes.
Output and state effect#
Writes the payload with the first clipboard writer this platform offers (pbcopy, then the Windows and Wayland/X11 writers), the same order /copy uses inside a session, then reads the clipboard back and answers only when it holds the payload. Nothing is stored, logged or sent anywhere else.
Refusals and boundaries#
- Every refusal is a cause of
jeden.copyand ends withfix:andcause: jeden.copy.<cause>;jeden errors show jeden.copyprints each with its test (tests/clipboard/copy.mjs). - Exit
2:payload-missing(copy requires the text to hand over, or - to read the payload from stdin;/copywithout text too) andstdin-terminal(copy - reads the payload from stdin, and stdin is a terminal here). - Exit
1:stdin-unreadable(standard input is not UTF-8 text),payload-empty(refusing to copy an empty payload),writer-none(no clipboard writer answered on <os>, observed: every writer tried and what each said, such aspbcopy cannot be started: No such file or directory),unconfirmed(a writer accepted the payload and no reader can confirm it),mismatch(the writer exited zero and the clipboard holds other bytes),reader-none(--checkwith no reader answering) andnot-held(the clipboard no longer holds the payload, observed: what the reader reads). - A command line of the wrong form (an unknown command or option, a missing, unexpected or invalid argument, a missing confirmation) prints the error and the usage and exits
2; a refusal that retrying unchanged can help (a dependency down or not answering, a rate limit) exits69; any other refusal or failure exits1. A refusal a functionality declares ends withfix: …andcause: <operation>.<cause>, andjeden errors show <operation>lists every cause of that functionality.