{
  "id": 13105760,
  "title": "Once: Cache CLI Commands",
  "url": "https://urgent.news/2026/10/09/once-cache-cli-commands",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-09T09:43:06.000Z",
  "source": {
    "name": "Hacker News",
    "slug": "hacker-news",
    "url": "https://github.com/alex0ptr/once"
  },
  "original_language": "en",
  "account": "The \"once\" CLI tool allows you to execute a command once and reuse its output for a specified period. When you run a command with \"once,\" it executes the command in your current directory and stores the standard output in memory within a background daemon. Subsequent calls to the same command, directory, and tenant key within 8 hours will retrieve the cached output instead of re-running the command. The daemon automatically stops when all cached entries expire.\n\nTypically, \"once\" is used to read secrets like those from 1Password without repeatedly authenticating with a fingerprint. By running \"once\" once, subsequent calls within an 8-hour window won't require the fingerprint for authentication.\n\nTo set up \"once,\" you can create a configuration file named \"mise.local.toml\" and specify options and commands in it. The tool supports various formatting options for the --until flag to set the expiration time of the cached entry. The default working directory is included in the cache key, but you can exclude it using the --no-dir flag for commands with directory-independent outputs.\n\nThe cache key is generated using an HMAC-SHA256 hash of the tenant key, working directory, command, and arguments. The tenant key serves as a namespace and is not meant to be kept secret. Multiple terminals can share the same cache by using a fixed tenant key.\n\nThe daemon runs in a secure, user-specific directory with restricted permissions, ensuring that other users cannot access the cache. The cache is stored in a socket accessible only to the user running \"once.\" By default, the working directory is part of the cache key, but you can use the --no-dir flag for commands with directory-independent outputs.",
  "summary": null,
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}