Built-in Plugins
@keq-request/cli provides a rich set of built-in plugins to help you generate high-quality TypeScript code from OpenAPI documents.
Plugins fall into two categories: optional plugins that require manual configuration and core plugins that are automatically enabled.
Optional Plugins
The following plugins must be manually added to the configuration file to take effect. Choose based on your project needs.
| Plugin Name | Description |
|---|---|
| BodyFallbackPlugin | Adds undefined request parameters to the request body instead of discarding them |
| ChineseToPinyinPlugin | Automatically converts Chinese identifiers in OpenAPI documents to pinyin |
| EslintPlugin | Automatically runs ESLint formatting (eslint --fix) after code generation |
| PrettierPlugin | Automatically runs Prettier formatting (prettier --write) after code generation |
| OverwriteOperationIdPlugin | Overrides operationId fields in OpenAPI documents based on custom rules |
| OverwriteAdditionalPropertiesPlugin | Forces object schemas without additionalProperties to set additionalProperties: false |
| OverwriteQueryOptionsPlugin | Customizes URL query parameter formatting |
| LintSchemaPlugin | Validates Schema compliance in OpenAPI documents using JSON Schema Draft 2020-12 meta-schema |
| UseValibotPlugin | Generates components/schema using Valibot |
| MockPlugin | Injects mock data hints into Schemas for more realistic mock data generation with keq mock |
| SpringdocCompatPlugin | Fixes compatibility issues with nested extensions objects in SpringDoc-generated documents |
| OverwriteSchemaNamePlugin | Renames Schema names in components.schemas based on custom rules |
Core Plugins
The following plugins are automatically enabled by the CLI based on configuration — no manual setup required. They handle core functionality like document downloading and code generation.
| Plugin Name | Description |
|---|---|
| DownloadHttpFilePlugin | Downloads OpenAPI documents from HTTP/HTTPS URLs |
| DownloadLocalFilePlugin | Loads OpenAPI documents from the local filesystem |
| GenerateDeclarationPlugin | Generates TypeScript type declaration files |
| GenerateMicroFunctionPlugin | Generates function-style API calling code |
| GenerateNestjsModulePlugin | Generates NestJS module code |
| InitialPlugin | Core plugin responsible for loading other plugins based on configuration |
| ShakingPlugin | Removes unused Schema definitions from OpenAPI documents |
| TerminalSelect | Provides terminal interactive selection functionality |