CLI Options
Options
Section titled “Options”-i, –input
Section titled “-i, –input”The input file path of the OpenAPI schema file. This is a required option.
-o, –output <value>
Section titled “-o, –output <value>”The output directory path for the generated files. The default value is openapi.
–pageParam <value>
Section titled “–pageParam <value>”Name of the query parameter used for pagination (infinite query). The default value is page.
–nextPageParam <value>
Section titled “–nextPageParam <value>”Name of the response parameter used for next page. The default value is nextPage.
–initialPageParam <value>
Section titled “–initialPageParam <value>”Initial page value to infinite query. The default value is 1.
–omitInitialPageParam
Section titled “–omitInitialPageParam”Send no initial page parameter at all. When set, the generated infinite queries use initialPageParam: undefined and omit the page parameter from the first request entirely, so the initial page is fetched without it. Useful for APIs that expect no page parameter (or an empty one) on the first request. This overrides --initialPageParam.
Client Options
Section titled “Client Options”The generated clients (under the openapi/requests directory) are produced by @hey-api/openapi-ts using its plugins system. The CLI options below are mapped to the corresponding plugin configurations.
You can see the current configuration in the generate function.
-c, –client <value>
Section titled “-c, –client <value>”The HTTP client to use for the generated hooks. The default value is @hey-api/client-fetch.
The available options are:
@hey-api/client-fetch@hey-api/client-axios
Note: these client plugins are provided by @hey-api/openapi-ts, so you don’t need to install @hey-api/client-fetch or @hey-api/client-axios separately. If you use the axios client, you still need to add axios to your project dependencies.
More details about the clients can be found in Hey API Documentation
–format <value>
Section titled “–format <value>”Process the generated queries output folder (openapi/queries) with a formatter. The openapi/requests directory generated by @hey-api/openapi-ts is not affected by this option. The default value is false.
The available options are:
biomeprettier
–lint <value>
Section titled “–lint <value>”Process the generated queries output folder (openapi/queries) with a linter. The openapi/requests directory generated by @hey-api/openapi-ts is not affected by this option. The default value is false.
The available options are:
biomeeslint
–noOperationId
Section titled “–noOperationId”Do not use operation ID to generate operation names. The default value is true.
–enums <value>
Section titled “–enums <value>”Generate enum definitions? The default value is false.
The available options are:
javascripttypescript
–useDateType
Section titled “–useDateType”Use Date instead of string for date and date-time model properties.
Generated SDK transformers also convert matching response values into Date
objects at runtime. The default value is false.
–debug
Section titled “–debug”Deprecated: This option is currently accepted but has no effect. It will be removed in a future version.
Run in debug mode? The default value is false.
–noSchemas
Section titled “–noSchemas”Disable generating JSON schemas. The default value is false.
–schemaType <value>
Section titled “–schemaType <value>”Type of JSON schema. Only applies when --noSchemas is not set. The default value is json.
The available options are:
jsonform