Cache and offline use

One cache for every project

viv keeps every package it downloads in one store and links from there, so a second project with the same dependencies installs in milliseconds and without touching the network.1

The cache command

Cache maintenance: prune stale entries, or remove the cache outright

Usage: viv cache [OPTIONS] <COMMAND>

Commands:
  prune  Remove stale buckets, orphan temp dirs, orphan `.ok` markers, and any archive no dist pointer references any more
  clean  Remove the whole cache after confirming it looks like a vivace cache (only our own bucket names, or empty); refuses otherwise
  size   Print archive and dist-pointer counts and total size
  help   Print this message or the help of the given subcommand(s)

Options:
  -v, --verbose                Raise logging to debug
      --cache-dir <CACHE_DIR>  Store location (default `$XDG_CACHE_HOME/vivace`, or `~/.cache/vivace`)
      --offline                Fail fast on any request instead of connecting: install errors, naming every package not already in the store; update solves from cached repository metadata only, erroring on an uncached package. Also set by `COMPOSER_DISABLE_NETWORK` (any value but unset, empty or `0`; Composer's own git-priming `prime` value is not special-cased here, since neither `install` nor `update` touch a git source)
  -h, --help                   Print help

--cache-dir points the store somewhere other than the default ($XDG_CACHE_HOME/vivace, or ~/.cache/vivace); pass it to any command that touches the store. --offline fails fast on any request instead of connecting: install errors, naming every package not already in the store, and update solves from cached repository metadata only, erroring on an uncached package.


  1. The store lives under $XDG_CACHE_HOME/vivace/, keyed by the sha256 hash of each package archive, and installing hardlinks files from it into vendor/ instead of extracting them again. Store files are read-only, so an accidental edit to a vendor file fails instead of silently changing every project that shares that file on disk; projects that patch their vendor files should use --link-mode copy instead. A no-op install compares the lock against vendor/composer/installed.json and a small state file, without spawning PHP or making a network request. The autoloader files (vendor/autoload.php, vendor/composer/*.php, installed.json, installed.php, platform_check.php) are generated by a port of Composer's own generator, tested against Composer's own golden test cases, and checked end to end by byte-diffing vendor/ against real Composer 2.10.2 output. See ARCHITECTURE.md, docs/composer-contract.md and docs/stability.md for the detail. ↩