Port the quak CLI to the library API (closes #52)
check / check (push) Successful in 17s

Ports the CLI to the library API. collections/files/get/get-thumb use the fresh read variants (Library.fresh(), current server state); backup runs lib.backup; backup-metadata and the missing-thumbnail helpers enumerate via the library. files/get output is byte-identical to the pre-port CLI — raw metadata.title, microsecond creationTime, pre-port row order — exit codes unchanged. Adds --cache-dir; fixes the helper JPEG-only assumption (closes #17).

Model: opus-4-8
This commit was merged in pull request #74.
This commit is contained in:
2026-09-23 00:00:55 +02:00
parent aeccb489b5
commit d23d3f8f47
11 changed files with 976 additions and 367 deletions
+15 -3
View File
@@ -420,6 +420,7 @@ you would treat the password itself.
### CLI surface
```
quak [--cache-dir <path>] <command> global: local metadata/content cache location
quak login interactive or QUAK_EMAIL/QUAK_PASSWORD
quak whoami print logged-in account as JSON
quak logout delete saved session
@@ -432,9 +433,20 @@ quak helper list-missing-thumbnails [--json] find files with missing thumbnai
quak helper fix-missing-thumbnails [--file ids] generate + upload missing thumbnails
```
`get` and `get-thumb` search all collections for the file ID when `--collection`
is not specified. All listing and backup commands support `--json` for
machine-readable output.
Every command reads through the local library cache: the first run fetches the
account's metadata from the server, and later runs serve from the cache and
refresh in the background. `--cache-dir` overrides where that cache lives;
without it each account gets its own directory under the per-user cache path.
`get` and `get-thumb` resolve the file by ID directly, so `--collection` is
accepted for backward compatibility but ignored. All listing and backup commands
support `--json` for machine-readable output.
`helper fix-missing-thumbnails` regenerates thumbnails for baseline JPEG images
only, because the bundled decoder (`jpeg-js`) decodes only JPEG. A non-JPEG
image (PNG, HEIC) or a video is reported as `skipped` (unsupported format), kept
distinct from a `failed` repair, and does not affect the exit code; a genuine
failure still exits non-zero.
### Backup layout