generate
Generate TypeScript code from your Swagger/OpenAPI specification. This is the main command for creating your API client.
Usage
Options
-i, --input <path>Path or URL to Swagger/OpenAPI file
Required-o, --output <dir>Output directory (default: ./src/api)
-t, --template <name>Template: tanstack-query, rtk-query, swr, react-query-kit, basic (default: tanstack-query)
--http-client <client>HTTP client: axios or fetch (default: axios)
--validator <validator>Schema validator: zod or yup (default: zod)
--strip-base-path [path]Strip base path from routes
--include-tags <tags>Only generate specific tags (comma-separated)
--exclude-tags <tags>Exclude specific tags (comma-separated)
--preserve-modifiedSkip overwriting modified files
-u, --username <username>Basic auth username
-p, --password <password>Basic auth password
Examples
Basic generation
Generate with default settings (TanStack Query + Axios + Zod)
Custom output directory
Specify a custom output location
Using RTK Query template
Generate with Redux Toolkit Query
Filter by tags
Only generate specific endpoints
From URL with authentication
Fetch Swagger spec from a protected URL