fix: lazysecrets list puts the name first, and keeps errors out of fzf

This commit is contained in:
keb committed 2026-10-14 21:24:01 +02:00
1 parent e99462bd21
commit baee1dfe61
3 files changed
+35 -18

No files matched your search

+12 -9
View File
@@ -139,22 +139,24 @@ a newline only on a terminal.
### Listing, for fzf and pickers
`lazysecrets list` prints every source, vault and secret, one per line:
its link, its kind (`source`, `vault`, `secret`, `key`, `certificate`)
and its name, tab-separated. It's what Go to searches, so fzf, or an
editor's picker, can search it instead:
its name (`platform-prod / kv-app-prod / db-password`), then 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 --delimiter='\t' --with-nth=3 \
--bind 'enter:become(lazysecrets open {1})' \
--bind 'ctrl-y:execute-silent(lazysecrets get {1} | pbcopy)'
lazysecrets list | fzf --ansi --delimiter='\t' --with-nth=1 \
--bind 'enter:become(lazysecrets open {2})' \
--bind 'ctrl-y:execute-silent(lazysecrets get {2} | pbcopy)'
```
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
Azure or Databricks, for an answer at once. Repos are always read, from
disk. What it loads is cached for the TUI too. Lists it can't read are
reported on stderr; it stops when the reader goes, after a pick in fzf.
disk. What it loads is cached for the TUI too. It stops when the reader
goes, after a pick in fzf. Lists it can't read are reported on stderr when
it prints to the terminal; into a pipe they'd draw over fzf, so only with
`--errors`.
The name is coloured from your [theme](config.md#theme), with the
provider's icon when [icons](config.md#theme) are on (`ui.icons`); fzf
@@ -162,7 +164,8 @@ shows the colours with `--ansi`. `--color never` leaves them out, for
scripts, and `--icons=false` the icons. The link is never coloured.
`--format json` prints an object per line instead, for editor plugins,
without colours or icons:
without colours or icons, with each entry's kind (`source`, `vault`,
`secret`, `key` or `certificate`):
```json
{"link":"lazysecrets://azure/kv-app-prod.vault.azure.net/secrets/db-password","kind":"secret","provider":"azure","path":["platform-prod","kv-app-prod","db-password"],"account":"alice"}