What to build
A new manual-only clear-cache subcommand that removes cached copies from OpenCode's package cache. Default targets this package; destructive broad modes require explicit confirmation.
Cache root: join(XDG_CACHE_HOME || join(homedir(), ".cache"), "opencode", "packages").
Modes:
- default (no flags): remove
opencode-architect and every opencode-architect@*
--package <name>: remove <name> and every <name>@*; requires --yes, otherwise exit 1 with a usage message
--all: remove the entire OpenCode cache directory (the opencode directory under the cache root, not just packages/); requires --yes
--package and --all are mutually exclusive
- reject
--package values containing path separators or ..
The command is idempotent: no cached copies is a success. Deletion failures warn and continue; exit 0 unless the cache location cannot be read at all. It is never invoked automatically by any load-time hook.
Acceptance criteria
Blocked by
What to build
A new manual-only
clear-cachesubcommand that removes cached copies from OpenCode's package cache. Default targets this package; destructive broad modes require explicit confirmation.Cache root:
join(XDG_CACHE_HOME || join(homedir(), ".cache"), "opencode", "packages").Modes:
opencode-architectand everyopencode-architect@*--package <name>: remove<name>and every<name>@*; requires--yes, otherwise exit 1 with a usage message--all: remove the entire OpenCode cache directory (theopencodedirectory under the cache root, not justpackages/); requires--yes--packageand--allare mutually exclusive--packagevalues containing path separators or..The command is idempotent: no cached copies is a success. Deletion failures warn and continue; exit 0 unless the cache location cannot be read at all. It is never invoked automatically by any load-time hook.
Acceptance criteria
clear-cacheremoves only this package's cache dirs--package <name>removes only that package's cache dirs and requires--yes--allremoves the whole OpenCode cache dir and requires--yes--yesfor a broad mode exits 1 without deleting anything--package+--alltogether exits 1--packagevalues exit 1--helpand README list the command; CHANGELOG notes itBlocked by