GemSync
GemSync is the code generator that ships with @gemzero0/sdk-core (the
gemsync binary). It asks your project’s API for the generated tRPC router
and writes it to gemRouter.ts. That one file is what makes every SDK call
typed against your actual schema.
Requirements
Section titled “Requirements”GEM_URL and GEM_KEY must be set, either in the environment or in a .env
file in the directory you run it from:
GEM_URL=https://sdk.gem0.devGEM_KEY=your-project-api-keyRunning it
Section titled “Running it”bunx gemsyncWrites gemRouter.ts to the current directory. Two options:
| Invocation | Effect |
|---|---|
bunx gemsync src/lib | Write gemRouter.ts into a subdirectory (it must exist). |
bunx gemsync --without-links | Generate types without linked-document expansion, matching queries that pass without_links: true. |
When to rerun
Section titled “When to rerun”Rerun GemSync after every schema change. Commit the generated gemRouter.ts
like any other source file: builds stay reproducible and the diff shows
exactly what changed in the content model.