Once caches CLI output so you only approve 1Password reads once
Once: Cache CLI Commands
Once is a Go-based tool that runs a command in your current directory, prints its stdout, and caches the result in a small per-user daemon. Repeated calls with the same command, directory, and tenant key are served from memory until the TTL expires, so you can read secrets from 1Password without approving every read with your fingerprint. It supports TTLs, absolute expiry times, and directory-independent caching.
The typical use case: reading secrets from 1Password without approving every single read with your fingerprint.
- aktau
These kinds of tools are very useful. I have my own called memo (which is just a shell script: https://github.com/aktau/dotfiles/blob/master/bin/memo).
It was discussed in https://news.ycombinator.com/item?id=45670052 and others chimed in with their own (like bkt(1) and up(1)).
The main differences I see:
- memo doesn't need to be built (its a shell script)
- once keeps output cache in a running daemon. By contrast, memo stores content under /tmp with whatever the best compression available is (it prefers zstd). There's trade-offs in that. More pareto-optimal from the security front may be to have a sort of session key and to compress-then-encrypt files on disk.
- __MatrixMan__
I dream of applications that expose sufficient metadata about their outputs such that the OS can know if rerunning is necessary without me needing to specify.
Nixos does this for builds, but I've not seen it generalized to arbitrary processes.
- xuhu
I wish this worked without prefixing the commands with "once". Especially if I ran a command with verbose output and afterwards decided I wanted to grep something from it. Terminals have the output in their scrollback buffer and maybe it's just a matter of writing an "output" command that lets me run:
$ cmake ..
$ output | grep "libssl version"
- deadbunny
I've always wanted to deal with cache invalidation in my terminal.
- giancarlostoro
> The typical use case: reading secrets from 1Password without approving every single read with your fingerprint.
Uh I dont know about that one chief.