5 comments

  • aktau20 minutes ago
    These kinds of tools are very useful. I have my own called memo (which is just a shell script: <a href="https:&#x2F;&#x2F;github.com&#x2F;aktau&#x2F;dotfiles&#x2F;blob&#x2F;master&#x2F;bin&#x2F;memo" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;aktau&#x2F;dotfiles&#x2F;blob&#x2F;master&#x2F;bin&#x2F;memo</a>).<p>It was discussed in <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=45670052">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=45670052</a> and others chimed in with their own (like bkt(1) and up(1)).<p>The main differences I see:<p><pre><code> - memo doesn&#x27;t need to be built (its a shell script) - once keeps output cache in a running daemon. By contrast, memo stores content under &#x2F;tmp with whatever the best compression available is (it prefers zstd). There&#x27;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.</code></pre>
  • deadbunny28 minutes ago
    I&#x27;ve always wanted to deal with cache invalidation in my terminal.
  • xuhu26 minutes ago
    I wish this worked without prefixing the commands with &quot;once&quot;. 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&#x27;s just a matter of writing an &quot;output&quot; command that lets me run:<p><pre><code> $ cmake .. $ output | grep &quot;libssl version&quot;</code></pre>
  • stingraycharles37 minutes ago
    Seems well-designed, but what’s the use case? I’m trying to think of them but my creativity is failing me.
    • adregan8 minutes ago
      I have a small fish function that does something similar. It saves output to a file in XDG_CACHE_HOME. I wouldn’t use it for sensitive items like passwords or tokens in the examples, but I do use it for scripts that need to fetch some data from the network.<p>For example, I have a script for automating the creation of PRs which fetches the available labels for a repo from github and presents them with fzf multi select. I store the labels with a TTL of a week so that I don’t have to fetch them every time and the script compares the file’s age against the desired TTL to invalidate.<p>I find it useful for augmenting other programs, but I’m not typically using it on the cli directly.
    • frizlab33 minutes ago
      From the example in the Readme, I guess retrieving a token from an API, using a secret fetched from a secure vault that requests a password or TouchID validation.<p>Not sure if there could be other interesting uses. I can’t think of one anyways.
    • whilenot-dev32 minutes ago
      I have the same question, especially since any CLI output can be stored explicitly in some variable or temp file. What&#x27;s the advantage of storing the output implicitly?
  • baquero2 hours ago
    Do you have CLI calls that you want to cache? Here you go!