docs: the fzf example for lazysecrets list hides the link and binds open and copy

This commit is contained in:
keb committed 2026-10-14 21:24:01 +02:00
1 parent 3734989b15
commit 572cea8351
2 files changed
+11 -4

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ import (
// listCmd prints every source, vault and secret lazysecrets can find, one // listCmd prints every source, vault and secret lazysecrets can find, one
// per line, for fzf, editor pickers and scripts: // per line, for fzf, editor pickers and scripts:
// //
// lazysecrets list | fzf --ansi --delimiter='\t' --with-nth=1 | cut -f2 // lazysecrets list | fzf --ansi --with-nth='..-2' --accept-nth=-1
// //
// Each line is the name, then the link: the name coloured from the theme, // Each line is the name, then the link: the name coloured from the theme,
// with the provider's icon (as in the TUI: --icons, LAZYSECRETS_ICONS, // with the provider's icon (as in the TUI: --icons, LAZYSECRETS_ICONS,
+10 -3
View File
@@ -144,11 +144,18 @@ tab-separated. It's what Go to searches, so fzf, or an editor's picker,
can search it instead, showing the names and acting on the links: can search it instead, showing the names and acting on the links:
```sh ```sh
lazysecrets list | fzf --ansi --delimiter='\t' --with-nth=1 \ lazysecrets list | fzf --ansi --with-nth='..-2' --accept-nth=-1 \
--bind 'enter:become(lazysecrets open {2})' \ --bind 'ctrl-o:become(lazysecrets open {-1})' \
--bind 'ctrl-y:execute-silent(lazysecrets get {2} | pbcopy)' --bind 'ctrl-y:execute-silent(lazysecrets get {-1} | pbcopy)'
``` ```
`--with-nth='..-2'` shows and searches the names, leaving out the link,
the last field; `{-1}` and `--accept-nth=-1` are the link. `enter` prints
it (`lazysecrets get $(…)`), `ctrl-o` opens it in lazysecrets and `ctrl-y`
copies the value (`pbcopy` on macOS; `wl-copy` or `xclip` on Linux). A
value copied this way isn't cleared from the clipboard after
`values.clipboardClear`, as one copied in lazysecrets is.
What's [cached](config.md#cache) prints at once. Then, like Go to, it loads What's [cached](config.md#cache) prints at once. Then, like Go to, it loads
what's missing or older than `--max-age` (2m), and what's new in it follows what's missing or older than `--max-age` (2m), and what's new in it follows
as it arrives: fzf shows it while you type. `--cached` loads nothing from as it arrives: fzf shows it while you type. `--cached` loads nothing from