Skip to content

ops: "splashboard cache" management CLI (list / clear) #40

Closed

Description

@unhappychoice

Motivation

The disk cache (`~/.cache/splashboard/`) is opaque to users today. For debugging ("why is my widget showing stale data?"), force-refresh ("blow away this widget's cache"), and housekeeping ("how much disk is this eating?"), they need a CLI.

Proposal

  • `splashboard cache list` — print each cache entry: key, widget id (if resolvable), age, TTL, fresh/stale, payload size. Sort by age descending.
  • `splashboard cache clear` — remove all cache entries. Confirm first unless `--yes`.
  • `splashboard cache clear <widget_id>` — remove a single widget's entry.
  • `splashboard cache path` — print the resolved cache directory. Useful for `rm -rf $(splashboard cache path)` or for docs.

Open questions

  • Key ↔ widget mapping: cache keys are `name-` (name + format). The widget id isn't stored in the cache entry. Options:
    1. Accept it — `clear <widget_id>` takes the current config and computes the key, so it only works if the widget is still configured.
    2. Stash the widget_id alongside the entry on write (tiny schema bump).
      First pass: option 1. It solves the 95% case and keeps the cache format unchanged.
  • Output format: same story as `splashboard fetch` — human default, `--json` for scripting.
  • Stale lock files: should `cache list` also show `.lock` files, and should `cache clear` remove them? Probably yes; treat them as auxiliary files.

Non-goals

  • Manual edits to cache entries. If you need that, you probably want a ReadStore widget instead (`#`).
  • Cross-machine cache sync.

Activity

  1. added
    ops
    on Apr 21, 2026
  2. satyakwok commented on May 11, 2026

    @satyakwok
    Contributor

    Taking this.

    Plan: add a cache subcommand alongside fetch-only in the CLI dispatcher. Subcommands:

    • splashboard cache path — print resolved cache dir
    • splashboard cache list — iterate cache dir, print key / age / size / TTL / fresh-stale, sort by age desc; include .lock files as auxiliary
    • splashboard cache clear — remove all cache entries (and lock files); confirm prompt unless --yes
    • splashboard cache clear <widget_id> — compute the cache key from current config + remove that single entry

    Per your open question, going with option 1 for widget_id mapping (compute key from current config, only works if widget is still configured) — keeps the cache format unchanged. Human-readable output by default; --json flag for scripting.

    → PR opened: #

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ops

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions