# `Lei.Cache.Importer`
[🔗](https://github.com/gtri/lowendinsight/blob/main/lib/cache/importer.ex#L5)

Imports LEI cache snapshots from local directories or OCI artifacts.

Supports two import modes:
- Local directory import (from a previously exported or pulled cache)
- OCI pull + import (pulls from registry, then imports)

# `import_local`

```elixir
@spec import_local(String.t()) :: {:ok, map(), [map()]} | {:error, String.t()}
```

Imports a cache snapshot from a local directory.

Reads `manifest.json` and `cache.jsonl.gz` from the given directory.
Returns `{:ok, manifest, reports}` where manifest is the cache metadata
and reports is a list of decoded analysis report maps.

# `pull`

```elixir
@spec pull(String.t(), String.t(), keyword()) ::
  {:ok, String.t()} | {:error, String.t()}
```

Pulls a cache artifact from an OCI registry and saves to `target_dir`.

Parses the OCI reference, pulls the manifest and blobs, and writes
cache files to the target directory.

Returns `{:ok, target_dir}` or `{:error, reason}`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
