Expand description
linkmarks sync — multi-device sync via yrs-encoded payload.
Status: preview / dry-run only. The local state encoding and the
wire format are validated; the actual POST /v1/sync round-trip is
pending in the relay binary.
What this subcommand does today:
- Open the local SQLite store.
- List every bookmark (
store::Store::listwith high limit). - Build a per-collection
yrs::Doc. Bookmarks are grouped byBookmark::collectionso each collection is a self-contained sub-doc — clients merge independently and the relay can serve a single collection without unpacking the whole library. - Encode each sub-doc via
yrs::encode_state_as_update_v1. - Print a summary table: collection name, bookmark count,
encoded bytes, hash (FNV-1a-64). No HTTP, no write to store,
no write to disk outside the optional
--out-dir.
--out-dir <PATH>: write each sub-doc’s encoded bytes to
<PATH>/<collection_slug>.ydoc.bin so the operator can inspect them
(e.g. xxd, wc -c, lz4 <file> to see the post-LZ4 wire size).
Exit codes:
- 0: dry-run completed, dry-run report printed.
- 1: store not initialized (run
linkmarks initfirst). - 2: bad args.
This subcommand is the pre-merge validation hook: running
linkmarks sync --dry-run on a freshly-imported library must produce
the same encoded size (within LZ4 compression tolerance) as a real
linkmarks sync --remote <relay> once the relay binary ships.