Skip to main content

luna cache

Inspect and safely remove Luna-owned cache entries and abandoned temporary workspaces.

Syntax​

luna cache info [--workspace <directory>]
luna cache clean [--yes] [--workspace <directory>]
luna cache prune --days <N> [--yes] [--workspace <directory>]

Options​

OptionCommandsBehavior
--days <N>pruneSelect inactive entries at least N days old. Must be non-negative.
--yesclean, pruneConfirm deletion without an interactive prompt.
--workspace <directory>, -winfo, clean, pruneSelect the project used to derive the user cache namespace.
--log-level <level>, -llAllSet output verbosity.

--days 0 selects every inactive recognized entry. Omitting --days is valid only with luna cache clean.

Inspect cache use​

luna cache info reports every documented Luna cache location, including whether it is absent. Each existing location shows its recognized entry count and combined size. Each recognized entry shows its path, byte size, age, and active, inactive, or cleanup-selection state.

The command is read-only. It does not create a missing cache directory, resolve project configuration or user preferences, access credentials, or contact a configured source.

Managed locations​

ContentLocation
Git link content, Windows%LOCALAPPDATA%\LunaPack\cache\sources
Git link content, Linux$XDG_CACHE_HOME/lunapack/sources or ~/.cache/lunapack/sources
Git link content, macOS~/Library/Caches/LunaPack/sources
Current project Git catalog metadata<profile>/.lunapack/cache/git-sources/<project-sha256>
Legacy project Git catalog metadata<workspace>/.lunapack/git-sources
Git discovery workspaces<system-temp>/lunapack/git-sources/temporary
Pack and external-source workspaces<system-temp>/lunapack/operations
Link workspaces<system-temp>/lunapack/links
OCI workspaces<system-temp>/lunapack/oci

Only recognized entry names below those roots are managed. The roots and unrecognized children remain untouched. Luna never accepts a custom deletion root from the command line.

Age and size​

An entry's byte size is the sum of its regular files. Its age is measured from the newest owned file or directory last-write timestamp to the inventory time. A timestamp later than the current time has age zero.

clean selects every inactive recognized entry. prune selects only entries whose age is at least the requested number of days. A live Luna operation holds an operating-system lease for its entry; cache commands report that entry as active and do not select it. If a process terminated, its lease no longer exists, so a later command can reclaim the stale generated workspace.

Confirmation and cleanup​

clean and prune show the selected entries before deletion. At an interactive terminal, the prompt defaults to No. In non-interactive use, you must pass --yes; without it, Luna deletes nothing and returns an error.

Cleanup rechecks each selected entry immediately before deletion. A newly active entry is skipped. Recognized symbolic-link, junction, reparse-point, traversal, or unrelated content is never followed or deleted.

Removed cache and temporary data is generated. Luna can rebuild it on a later operation, which can require another download or source query.

Exit behavior​

  • 0: inspection or cleanup completed, including cancellation, an empty selection, or active-entry skips.
  • 1: usage is invalid, confirmation is missing in non-interactive mode, or one or more required inventory/removal operations failed.

Cleanup continues after an individual entry failure, reports every failure, and returns 1 after attempting the other independently eligible entries.

Examples​

luna cache info
luna cache prune --days 30
luna cache prune --days 30 --yes --workspace ../another-project
luna cache clean --yes