feat: lazysecrets open --action goes, copies or shows without asking

This commit is contained in:
keb committed 2026-10-14 21:24:01 +02:00
1 parent b05d19209c
commit a4002a785c
4 files changed
+65 -19

No files matched your search

+7 -2
View File
@@ -121,6 +121,9 @@ account) and jumps to it, asking which account to use when several can see
it, ending on a secret's details as `enter` on it would. Links say what,
not what to do: opening a link to a secret asks whether to just go to it,
also copy or show its value, or (`y`) copy its value without going there.
`lazysecrets open --action go|copy|show <link>` does one without asking,
and `--account <account>` picks the account (as [`list`](#listing-for-fzf-and-pickers)
prints it) when several can see it.
## In scripts
@@ -153,7 +156,7 @@ instead, showing the names and acting on the links:
```sh
lazysecrets list | fzf --ansi --with-nth='2..-3' --accept-nth=-1 \
--bind 'ctrl-o:become(lazysecrets open --account {-2} {-1})' \
--bind 'ctrl-o:become(lazysecrets open --action go --account {-2} {-1})' \
--bind 'ctrl-y:execute-silent(lazysecrets get --account {-2} {-1} | pbcopy)'
```
@@ -170,7 +173,9 @@ clipboard after `values.clipboardClear`, as one copied in lazysecrets is.
`--account` makes `open` and `get` use the account it was listed through,
when several of yours can see it: without, `open` asks which, and `get`
tries the one that last read it first. The link stays as it is, to copy
and share; the account isn't part of it.
and share; the account isn't part of it. `--action` tells `open` what to
do rather than asking, as it does for a link clicked elsewhere: `go` to
it, `copy` its value too, or `show` it.
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