Command reference
ed clipboard
ed clipboard is the clipboard panel as a command: the history Edith captures,
what it weighs, and the same act of putting an entry back on the pasteboard that
clicking a row performs. Reach for it when you want the thing you copied ten
minutes ago without leaving the terminal, or when a script needs the last thing
that landed on the pasteboard.
The history is a file on disk, index.jsonl under
~/Library/Application Support/Edith/clipboard, with the bytes behind the
entries in blobs/ beside it. You do not need to open Edith first: ed starts it in the background when needed. Mutations post the
clipboardChanged notification afterwards, which is what makes an open panel
redraw; when nothing is listening the post is a no-op and the write still
stands.
Entries are numbered from 1 in the same order the panel shows them: pinned
first, then most recently copied, honouring clipboardPinTo. That number is
what get, copy, pin, unpin and rm take, and it names the same entry
the UI would act on.
At a glance
| Command | What it does |
|---|---|
ed clipboard ls |
List the history, pinned first, with each entry's number |
ed clipboard stats |
How many entries there are, what they weigh, and the split by family |
ed clipboard get <index> |
Print one entry as plain text on stdout |
ed clipboard inspect <index> |
List or preview the representations of one entry |
ed clipboard copy <index> |
Put one entry back on the pasteboard and bump it to the top; --type copies one representation |
ed clipboard pin <index> |
Keep one entry at the top and out of the retention sweep |
ed clipboard unpin <index> |
Let one entry age out again |
ed clipboard rm <index> |
Preview forgetting one entry and deleting its blob; --yes applies it |
ed clipboard clear |
Preview forgetting the whole history; --yes applies it |
ed clipboard scratch |
Edit text in a floating scratch buffer, then copy or save it |
A bare ed clipboard runs ls. ls also answers to list, and stats also
answers to size.
Commands
ed clipboard lsed clipboard statsed clipboard geted clipboard inspected clipboard copyed clipboard pined clipboard unpined clipboard rmed clipboard cleared clipboard scratch
Exit codes
| Code | When this group produces it |
|---|---|
| 0 | The command did what it says, including --help, an empty ls, and pinning something that was already pinned |
| 1 | get on an entry that is not text: error: entry png is not text |
| 2 | --limit below zero, or a command line ArgumentParser cannot parse, such as a non-numeric index or an unknown flag |
| 3 | No entry with that number, or the blob behind an entry is missing |
| 4 | The history is empty and you named a number |
The empty case is the one that surprises people. Every verb that takes a number goes through the same lookup, and that lookup calls an empty history unavailable rather than not-found, because the usual reason for it is that the extension has never been on:
$ ed clipboard pin 1error: the clipboard history is emptyhint: turn the Clipboard extension on with `ed extensions enable clipboard`A number outside a non-empty history is a plain 3, and the hint tells you the range:
$ ed clipboard get 9999error: there is no clipboard entry 9999hint: the history holds 1217 entries, numbered from 1A negative limit is caught before anything is read:
$ ed clipboard ls --limit=-1error: --limit cannot be negativehint: pass 0 or moreNotes and gotchas
- Numbers are positions, ids are identities. Any copy, pin, unpin, removal,
or anything you copy anywhere else on the Mac while the extension is on
reshuffles the list. A script that acts on more than one entry should read
idfrom--jsonand re-derive the number, rather than caching a number from an earlier run. copyreorders,getdoes not.copybumpslastCopiedAtthe way clicking a row does, so entry 4 becomes entry 1 and everything above it slides down.getonly reads.kindmeans two different things. In an entry object it is the file extension; insidestats'sbyKindit is the family.familyon an entry object is the value that lines up with abyKindrow.removedmeans two different things.rmreports the index it removed,clearreports how many it removed. Both sit next to aremainingcount.- Ordering follows the panel, not the file. Pinned entries come first, each
group sorted by most recent copy.
ed config set clipboardPinTo bottomflips the two groups, anded clipboard lsfollows it, so the same number can name a different entry after that setting changes. The command's own help text says "newest first", which is only true when nothing is pinned. - Mutations take a file lock. Copy, pin, unpin, remove and clear hold an
exclusive lock on
~/Library/Application Support/Edith/clipboard/.lockwhile they rewrite the index, soedand a running Edith cannot interleave writes. Reads do not take the lock, so a very longlscan race a capture and simply show the older list. - Removal is permanent.
rmandclearpreview exact ids and need--yes. Neither has a Trash step, and there is noed clipboardverb that restores anything. - The extension does not gate reading.
ed clipboard lsreports whatever is on disk even with the Clipboard extension off; the extension is what captures new entries.ed extensions enable clipboardturns capture on, anded config ls --group clipboardlists the retention, hotkey, ignore-list and capture switches that shape what ends up here. - Secret refusal is opt in. With Skip likely passwords and keys on in
Clipboard settings (
clipboardRefuseSecrets), a copy whose text looks like a token, private key or password assignment is not recorded. Only the first 1 MB of a copy is checked; longer text is still recorded. File links and file lists are never checked, and HTML is checked as its visible text. previewis a preview. It is capped at 500 characters, so it is a search target and a display string, not the content. Usegetfor the content.- Exit 4 means an empty history. Nothing else in this group produces it.
Where to go next
ed color, the other history the picker keeps, and the second command group defined in the same source fileed extensions, to turn clipboard capture on or offed config, for theclipboardgroup of settings that decide what is captured and how long it is kept- All command groups