feat: lazysecrets list prints every source, vault and secret, for fzf and editor pickers

This commit is contained in:
keb committed 2026-10-14 21:24:01 +02:00
1 parent dbb0eb2bbd
commit b1455451e6
13 files changed
+886 -91

No files matched your search

+2 -1
View File
@@ -140,7 +140,8 @@ you: the Sources lists, vaults and scopes, and secrets' names and metadata
once, and anything older than two minutes reloads in the background when
you go to it, or when Go to searches it. While it does, the pane's
bottom border says how old what it shows is (`cached 3h ago`). Revealing
and copying always fetch the value live.
and copying always fetch the value live. [`lazysecrets list`](links.md#listing-for-fzf-and-pickers)
reads it and adds to it too.
Lists not loaded for 30 days are dropped, and so is everything from an
account you're no longer signed in to. Repos aren't cached: their files
+29
View File
@@ -136,6 +136,35 @@ it first), the Databricks profile for the workspace, or sops in your clone
of the repo; a version in the link reads that version. The value ends with
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:
```sh
lazysecrets list | fzf --delimiter='\t' --with-nth=3 \
--bind 'enter:become(lazysecrets open {1})' \
--bind 'ctrl-y:execute-silent(lazysecrets get {1} | 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.
`--format json` prints an object per line instead, for editor plugins:
```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"}
```
`account` is there when several az accounts are signed in. Values are never
listed.
## From the browser and chat
```sh