Docs / TypeScript

Codegen CLI

npx zpi codegen crawls the catalog (concurrency 5) and emits a types-only .d.ts with zero runtime imports. Endpoints with unusable schemas fall back to Record<string, unknown> — never any.

terminal
npx zpi codegen --base https://api.zapi.ink --out ./zpi-sdk.gen.d.ts # narrow to one category, authenticate for gated schemasnpx zpi codegen --filter social --key zpi_xxx
npx zpi codegen --base https://api.zapi.ink --out ./zpi-sdk.gen.d.ts # narrow to one category, authenticate for gated schemasnpx zpi codegen --filter social --key zpi_xxx
FlagPurpose
--baseCatalog origin (or env ZPI_BASE_URL — CLI only).
--outOutput path; defaults to ./zpi-sdk.gen.d.ts.
--filterLimit generation to matching scrapers (e.g. social).
--keyAPI key, for schemas that require auth.

--base

Catalog origin (or env ZPI_BASE_URL — CLI only).

--out

Output path; defaults to ./zpi-sdk.gen.d.ts.

--filter

Limit generation to matching scrapers (e.g. social).

--key

API key, for schemas that require auth.

Programmatic use: generate({ baseURL, out, fetch?, filter?, key? }) from zpi-sdk/codegen resolves to { written, scrapers, endpoints }.

Edit this page on GitHubWas this page helpful? ·