Cache/API implementation (#36), phase 5.
Depends on the backup-rewrite unit (and the read surface).
Goal
Port the quak CLI (bin/quak.ts) to the new library API. Commands, flags,
output, and exit codes stay as they are, plus the new directory options.
Scope
collections → lib.albums.list(). files --collection → lib.albums.byID()
then album.photos.list().
get / get-thumb → lib.photos.byID() then photo.original() / photo.thumbnail(), copied to --out (default as today). Removes today's
scan of every album per call; --collection accepted and ignored.
backup <dir> → Library.open({ client, downloadDirectory: dir }), lib.backup({ onProgress }); typed events formatted into today's log lines; --json and exit 1 on failures unchanged.
backup-metadata <dir> and the *-missing-thumbnails helpers → enumerate via lib.albums/album.photos; the ML fetch, EXIF extraction, and thumbnail
upload stay where they are; --exif reads photo.original(). Address #17 (helper assumes JPEG) while here.
login, whoami, logout unchanged.
New global option --cache-dir (and honour cacheDirectory/downloadDirectory
defaults from the design).
Definition of done
Every command runs on the new API with unchanged external behaviour and exit
codes; --cache-dir works; CLI tests updated/added.
Dispatch notes: TDD; no scripted edits; no interactive questions; plain language.
Squash subject ends (closes #<this issue>). End every message with Model: opus-4-8.
Model: opus-4-8
Cache/API implementation (https://git.eeqj.de/sneak/quak/issues/36), phase 5.
Depends on the backup-rewrite unit (and the read surface).
## Goal
Port the `quak` CLI (`bin/quak.ts`) to the new library API. Commands, flags,
output, and exit codes stay as they are, plus the new directory options.
## Scope
- `collections` → `lib.albums.list()`. `files --collection` → `lib.albums.byID()`
then `album.photos.list()`.
- `get` / `get-thumb` → `lib.photos.byID()` then `photo.original()` /
`photo.thumbnail()`, copied to `--out` (default as today). Removes today's
scan of every album per call; `--collection` accepted and ignored.
- `backup <dir>` → `Library.open({ client, downloadDirectory: dir })`,
`lib.backup({ onProgress })`; typed events formatted into today's log lines;
`--json` and exit 1 on failures unchanged.
- `backup-metadata <dir>` and the `*-missing-thumbnails` helpers → enumerate via
`lib.albums`/`album.photos`; the ML fetch, EXIF extraction, and thumbnail
upload stay where they are; `--exif` reads `photo.original()`. Address
https://git.eeqj.de/sneak/quak/issues/17 (helper assumes JPEG) while here.
- `login`, `whoami`, `logout` unchanged.
- New global option `--cache-dir` (and honour `cacheDirectory`/`downloadDirectory`
defaults from the design).
## Definition of done
- Every command runs on the new API with unchanged external behaviour and exit
codes; `--cache-dir` works; CLI tests updated/added.
- `make check` green. Overlaps https://git.eeqj.de/sneak/quak/issues/17.
## Grounding
`bin/quak.ts`, CLI tests under `test/cli/`.
Dispatch notes: TDD; no scripted edits; no interactive questions; plain language.
Squash subject ends ` (closes #<this issue>)`. End every message with
`Model: opus-4-8`.
Model: opus-4-8
Opened #74 (branch issue-52-cli-port-redo, base next).
Every command now runs through Library.open: collections/files read lib.albums, get/get-thumb resolve lib.photos.byID() and copy the cached original/thumbnail to --out (so --collection is accepted but ignored). backup-metadata and the thumbnail helpers enumerate through the library and read originals via photo.original(); ML fetch, EXIF, and thumbnail upload are unchanged. Added the global --cache-dir; point commands open with the background precache off so a one-shot command never starts downloading the whole account.
Also addresses #17: fix-missing-thumbnails now reports a non-JPEG image or a video as skipped (unsupported), distinct from failed, and only a genuine failure exits non-zero.
Two judgement calls for the reviewer: reads are cache-first (design #36), so a just-added file can lag one refresh; and the files/collections JSON keeps its old keys while sourcing from the projected records, so creationTime is now milliseconds and collectionID is the requested album id.
make check and make build are green.
Model: opus-4-8
Opened https://git.eeqj.de/sneak/quak/pulls/74 (branch `issue-52-cli-port-redo`, base `next`).
Every command now runs through `Library.open`: `collections`/`files` read `lib.albums`, `get`/`get-thumb` resolve `lib.photos.byID()` and copy the cached original/thumbnail to `--out` (so `--collection` is accepted but ignored). `backup-metadata` and the thumbnail helpers enumerate through the library and read originals via `photo.original()`; ML fetch, EXIF, and thumbnail upload are unchanged. Added the global `--cache-dir`; point commands open with the background precache off so a one-shot command never starts downloading the whole account.
Also addresses https://git.eeqj.de/sneak/quak/issues/17: `fix-missing-thumbnails` now reports a non-JPEG image or a video as skipped (unsupported), distinct from failed, and only a genuine failure exits non-zero.
Two judgement calls for the reviewer: reads are cache-first (design #36), so a just-added file can lag one refresh; and the `files`/`collections` JSON keeps its old keys while sourcing from the projected records, so `creationTime` is now milliseconds and `collectionID` is the requested album id.
`make check` and `make build` are green.
Model: opus-4-8
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Cache/API implementation (#36), phase 5.
Depends on the backup-rewrite unit (and the read surface).
Goal
Port the
quakCLI (bin/quak.ts) to the new library API. Commands, flags,output, and exit codes stay as they are, plus the new directory options.
Scope
collections→lib.albums.list().files --collection→lib.albums.byID()then
album.photos.list().get/get-thumb→lib.photos.byID()thenphoto.original()/photo.thumbnail(), copied to--out(default as today). Removes today'sscan of every album per call;
--collectionaccepted and ignored.backup <dir>→Library.open({ client, downloadDirectory: dir }),lib.backup({ onProgress }); typed events formatted into today's log lines;--jsonand exit 1 on failures unchanged.backup-metadata <dir>and the*-missing-thumbnailshelpers → enumerate vialib.albums/album.photos; the ML fetch, EXIF extraction, and thumbnailupload stay where they are;
--exifreadsphoto.original(). Address#17 (helper assumes JPEG) while here.
login,whoami,logoutunchanged.--cache-dir(and honourcacheDirectory/downloadDirectorydefaults from the design).
Definition of done
codes;
--cache-dirworks; CLI tests updated/added.make checkgreen. Overlaps #17.Grounding
bin/quak.ts, CLI tests undertest/cli/.Dispatch notes: TDD; no scripted edits; no interactive questions; plain language.
Squash subject ends
(closes #<this issue>). End every message withModel: opus-4-8.Model: opus-4-8
Opened #74 (branch
issue-52-cli-port-redo, basenext).Every command now runs through
Library.open:collections/filesreadlib.albums,get/get-thumbresolvelib.photos.byID()and copy the cached original/thumbnail to--out(so--collectionis accepted but ignored).backup-metadataand the thumbnail helpers enumerate through the library and read originals viaphoto.original(); ML fetch, EXIF, and thumbnail upload are unchanged. Added the global--cache-dir; point commands open with the background precache off so a one-shot command never starts downloading the whole account.Also addresses #17:
fix-missing-thumbnailsnow reports a non-JPEG image or a video as skipped (unsupported), distinct from failed, and only a genuine failure exits non-zero.Two judgement calls for the reviewer: reads are cache-first (design #36), so a just-added file can lag one refresh; and the
files/collectionsJSON keeps its old keys while sourcing from the projected records, socreationTimeis now milliseconds andcollectionIDis the requested album id.make checkandmake buildare green.Model: opus-4-8