Skip to content

MakerRepo CLI – Cache

The cache subcommands let you list, view, and prune cache files produced by @cached-decorated functions in your repository. The CLI scans the current directory for @cached functions and uses a local cache directory where results are stored (e.g. as BREP files under <module>/<name>/<cache_key>.brep).

For the concept of cached functions and the @cached decorator, see Cached functions.

All examples below assume you run commands from the repository root.

List cache

List @cached-decorated functions discovered from the repo and their cache files. For each cached function, the table shows function (module/name), description, total size, per-file sizes, and cache file paths. If there are cache files that match the directory layout but no longer have a corresponding @cached function, they are listed as dangling at the end.

mr cache list

With no @cached functions found, the CLI reports that and, if the cache directory exists and contains files, prints a simple table of those files.

View cache file

Open a cache file in the OCP CAD viewer. Only BREP files (.brep) can be viewed. If you omit the path, an interactive prompt lets you select a file.

mr cache view [PATH] [OPTIONS]
Option Description
-p, --port OCP Viewer port to send the model data to (default: 3939).
--camera Camera preset when loading the model (e.g. reset). Default: reset.

PATH is relative to the cache directory (e.g. mymodule/myfunc/abc123.brep).

Prune cache files

Remove cache files. With no arguments, an interactive checkbox prompt lets you select which files to remove. You can instead use --all to remove everything, --dangling to remove only orphaned files (no matching @cached function), or pass one or more paths to remove specific files or directories.

mr cache prune [PATHS...] [OPTIONS]
Option Description
--all Remove all cache files.
--dangling Remove only dangling cache files (no matching @cached function).

PATHS are relative to the cache directory. You cannot combine --all with path arguments, or --dangling with path arguments.

Examples:

mr cache prune                    # interactive selection
mr cache prune --all              # remove everything
mr cache prune --dangling         # remove only orphaned files
mr cache prune mymodule/myfunc   # remove all cache files for that function