feat: lazysecrets list's text lines start with the kind

This commit is contained in:
keb committed 2026-10-14 21:24:01 +02:00
1 parent 572cea8351
commit 1f330bc619
2 files changed
+13 -8

No files matched your search

+7 -4
View File
@@ -139,18 +139,21 @@ a newline only on a terminal.
### Listing, for fzf and pickers
`lazysecrets list` prints every source, vault and secret, one per line:
its name (`platform-prod / kv-app-prod / db-password`), then its link,
its kind (`source`, `vault`, `secret`, `key` or `certificate`), its name
(`platform-prod / kv-app-prod / db-password`) and its link,
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 --with-nth='..-2' --accept-nth=-1 \
lazysecrets list | fzf --ansi --with-nth='2..-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
`--with-nth='2..-2'` shows and searches the names, leaving out the kind,
the first field, and the link, the last; `{-1}` and `--accept-nth=-1` are
the link. The kind is one word and the link has no spaces, so this works
without `--delimiter`. To filter by kind yourself: `awk -F'\t' '$1 == "secret"'`. `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