rereel hydrate
Restores the media/ directory of a bundle from rereel.lock.json. Files that are already present with the correct SHA-256 are left alone. build runs the same logic automatically, so you only need hydrate when you want the media without rendering.
Synopsis
Section titled “Synopsis”rereel hydrate <reel_dir> [--template-dir <dir>] [--offline] [--storage-config <path>]What it does
Section titled “What it does”- Reads
<reel_dir>/rereel.json(exit2if missing) and the lockfile named bylockFile(defaultrereel.lock.json). A missing lockfile is treated as empty. - For each lock item, with
dest = <reel_dir>/<key>:source: "template": counted astemplateStatic. If--template-diris given,<template-dir>/<templateRel>exists, anddestdoes not exist, the file is copied. Template items are not SHA-verified.destexists and its SHA-256 equalssha256: counted ascached.--offline: fails immediately (exit1) withrelPathanduriin the error details.- No
uri: fails (exit1). - Otherwise: calls
resolve()on the item’sprovider(or the default provider if the item has none) to writedest, then re-hashes the file. A missing file or a SHA-256 mismatch fails with exit1. Counted asfetched.
See SHA-256 verification for details.
Options
Section titled “Options”| Flag | Type | Default | Description |
|---|---|---|---|
<reel_dir> |
path (positional) | — (required) | Bundle directory. |
--template-dir |
path | — | Template root used to copy source: "template" items. Without it, template items are only counted. |
--offline |
flag | off | Never contact storage. Any storage item that is missing or has a different hash is an error. |
--storage-config |
path | lookup rules | Storage configuration file. |
Output
Section titled “Output”{ "status": "hydrated", "reelDir": "/abs/path/reels/ep01", "total": 12, "fetched": 3, "cached": 8, "templateStatic": 1}| Key | Description |
|---|---|
total |
Number of lock items (all sources). |
fetched |
Items downloaded/copied from a provider and verified. |
cached |
Storage items already present with a matching SHA-256. |
templateStatic |
Items with source: "template", whether or not they were copied. |
Exit codes
Section titled “Exit codes”| Code | When |
|---|---|
0 |
All storage items present and verified. |
1 |
Offline miss, item without uri, provider did not write the file, SHA-256 mismatch, or local-cache object not found. Error details may include relPath, uri, expected, actual. |
2 |
Missing <reel_dir> argument, missing/invalid rereel.json or lockfile JSON, unknown provider, invalid s3:// URI, missing S3 credentials, command provider without resolveCommand. |
3 |
A resolveCommand executable could not be spawned. |
4 |
Remote fetch failed (HTTP/S3 non-2xx, resolveCommand non-zero exit or no usable file). |
Examples
Section titled “Examples”Restore media after a fresh git clone:
rereel hydrate ./reels/ep01CI check that every asset is already on disk (no network):
rereel hydrate ./reels/ep01 --offline || echo "media not hydrated"Example SHA mismatch error:
{"status":"error","code":1,"error":"SHA-256 mismatch for media/bg_1a2b3c4d.png: expected 1a2b…, got 77ef…","relPath":"media/bg_1a2b3c4d.png","uri":"s3://my-video-assets/rereel/1a/1a2b….png","expected":"1a2b…","actual":"77ef…"}