TypeScript CLI and programmatic SDK for the OpenSea API.
cd packages/cli
pnpm run build
pnpm run test
pnpm run type-check
pnpm run lint
pnpm run formatopenseaCLI: Commander-driven commands for all OpenSea API v2 domains.OpenSeaCLI/OpenSeaClientSDK: typed, camelCase wrappers over the REST API.- Output formatting: JSON (default), table, and server-side TOON.
- Never hand-roll API request/response types. Import from
@opensea/api-typesviasrc/types/api.ts. Runpnpm --filter @opensea/api-types run update-spec && buildbefore adding endpoints. - API path check.
pnpm check-api-pathsfails if source code references an/api/v2/...URL not inpackages/api-types/opensea-api.json. - CLI commands are thin. Parse args, call
OpenSeaClient, format output withformatOutput(). Keep business logic in the client. - One file per domain in
src/commands/. Register new commands insrc/commands/index.tsand wire insrc/cli.ts. - SDK classes in
src/sdk.ts. Add domain classes asreadonlyproperties onOpenSeaCLIfor programmatic consumers. - Auth session invariants. Persisted tokens require access token, refresh token, wallet address, ISO expiration, scopes, and
oauth/siwemethod. Normalize only0x-prefixed EVM addresses to lowercase; preserve Solana base58 case. - Exit codes.
0success,1API error,2auth error,3rate limited.
- ESM-only,
.jsimport extensions,verbatimModuleSyntaxon. - Biome: double quotes, 2-space indent, trailing commas, 80-char line width.
- Native
fetchonly; no axios/got/node-fetch. - Cursor-based pagination with
--next <cursor>; never offset-based.