Jeden/Docs

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#

Shell
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: --check reads the clipboard and says whether it still holds the payload, writing nothing. --json returns 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.copy and ends with fix: and cause: jeden.copy.&lt;cause&gt;; jeden errors show jeden.copy prints 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; /copy without text too) and stdin-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 &lt;os&gt;, observed: every writer tried and what each said, such as pbcopy 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 (--check with no reader answering) and not-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) exits 69; any other refusal or failure exits 1. A refusal a functionality declares ends with fix: … and cause: &lt;operation&gt;.&lt;cause&gt;, and jeden errors show &lt;operation&gt; lists every cause of that functionality.