feat: lazysecrets list prints everything lazysecrets can find, for fzf and editor pickers #70
No files matched your search
@@ -26,7 +26,7 @@ import (
|
||||
// listCmd prints every source, vault and secret lazysecrets can find, one
|
||||
// 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,
|
||||
// with the provider's icon (as in the TUI: --icons, LAZYSECRETS_ICONS,
|
||||
|
||||
+10
-3
@@ -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:
|
||||
|
||||
```sh
|
||||
lazysecrets list | fzf --ansi --delimiter='\t' --with-nth=1 \
|
||||
--bind 'enter:become(lazysecrets open {2})' \
|
||||
--bind 'ctrl-y:execute-silent(lazysecrets get {2} | pbcopy)'
|
||||
lazysecrets list | fzf --ansi --with-nth='..-2' --accept-nth=-1 \
|
||||
--bind 'ctrl-o:become(lazysecrets open {-1})' \
|
||||
--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 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
|
||||
|
||||
Reference in new issue
Block a user