Once: Cache CLI commands

github.com

83 points by baquero 12 hours ago


ShakataGaNai - 3 hours ago

OMG. `op read` with agents. Holy shit.

I first clicked this with just a mild curiosity. But as soon as I saw the 1password example. Lightning.

I try to do everything "the right way", no secrets on disk, gitops, the whole shebang. Even for my personal projects. But when working with API keys and agents it can get so frustrating. I refuse to admit to the number of times where I've told the agent "Please write the 1Password creds to .env and use .env instead because I'm tired of clicking approve on my watch 15 times for every test run."

aktau - 9 hours ago

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__ - 7 hours ago

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 - 9 hours ago

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 - 9 hours ago

I've always wanted to deal with cache invalidation in my terminal.

hecomo - 6 hours ago

This looks awesome. Thanks for making this.

Been using this, for similar cli output catching. https://github.com/dimo414/bkt

Wondering what you think about the two, and what are the good reasons to use one vs the other? (Maybe: once is more actively developed? bkt hasn't been active for a year).

giancarlostoro - 8 hours ago

> The typical use case: reading secrets from 1Password without approving every single read with your fingerprint.

Uh I dont know about that one chief.

baquero - 12 hours ago

Do you have CLI calls that you want to cache? Here you go!

stingraycharles - 10 hours ago

Seems well-designed, but what’s the use case? I’m trying to think of them but my creativity is failing me.

1vuio0pswjnm7 - 5 hours ago

I just use tmux buffers

But I'm not running agents, I have different needs

newadays - 6 hours ago

Congratulations. What is Word Error Rate? We have a few use cases for something like that at newcare.app

hackerbluedev - 17 minutes ago

[flagged]

Rel8ble - 3 hours ago

[flagged]

singularityisne - 7 hours ago

[flagged]