File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
22sidebar_position : 3
3- sidebar_label : AsyncAPI CLI
3+ sidebar_label : AsyncAPI
44---
55
66# AsyncAPI mode (` qraft asyncapi ` )
@@ -19,7 +19,7 @@ npm install -D @qraft/cli @qraft/asyncapi-typescript-plugin
1919
2020## Usage
2121
22- ``` bash
22+ ``` bash npm2yarn
2323npx qraft asyncapi --plugin asyncapi-typescript ./asyncapi.yaml --output-dir src/events
2424```
2525
@@ -29,9 +29,9 @@ npx qraft asyncapi --plugin asyncapi-typescript ./asyncapi.yaml --output-dir src
2929
3030## Plugin selection
3131
32- Unlike legacy CLI flows where defaults could be implied, ` qraft asyncapi ` requires explicit plugin selection:
32+ ` qraft asyncapi ` requires explicit plugin selection:
3333
34- ``` bash
34+ ``` bash npm2yarn
3535npx qraft asyncapi --plugin asyncapi-typescript ./asyncapi.yaml -o ./src/events
3636```
3737
5252
5353Then run:
5454
55- ` ` ` bash
55+ ` ` ` bash npm2yarn
5656npx qraft asyncapi --redocly
5757# or generate both OpenAPI + AsyncAPI entries
5858npx qraft redocly
5959```
60-
61- ## Notes on compatibility
62-
63- - Existing OpenAPI generation remains available through ` qraft openapi ` .
64- - Existing OpenAPI plugins continue to work in OpenAPI mode.
65- - AsyncAPI plugins are additive and can coexist in the same project with OpenAPI plugins.
Original file line number Diff line number Diff line change @@ -9,39 +9,10 @@ sidebar_label: CLI overview
99
1010It supports ** two generation modes** :
1111
12- - ** OpenAPI mode** (` qraft openapi ` ) — keeps the existing OpenAPI generation flow and existing OpenAPI plugins.
13- - ** AsyncAPI mode** (` qraft asyncapi ` ) — enables generation from AsyncAPI documents with AsyncAPI plugins.
12+ - ** [ OpenAPI mode] ( /codegen/CLI/openapi-cli.mdx ) ** (` qraft openapi ` ) — generates code from OpenAPI documents with OpenAPI plugins.
13+ - ** [ AsyncAPI mode] ( /codegen/CLI/asyncapi-cli.mdx ) ** (` qraft asyncapi ` ) — enables generation from AsyncAPI documents with AsyncAPI plugins.
1414
15- This lets you use one CLI package and one binary (` qraft ` ) for both REST/OpenAPI and event-driven/AsyncAPI schemas.
16-
17- ## Installation
18-
19- ``` bash npm2yarn
20- npm install -D @qraft/cli
21- ```
22-
23- Install plugins depending on your use case:
24-
25- ``` bash npm2yarn
26- # OpenAPI plugins
27- npm install -D @openapi-qraft/tanstack-query-react-plugin @openapi-qraft/openapi-typescript-plugin
28-
29- # AsyncAPI plugin
30- npm install -D @qraft/asyncapi-typescript-plugin
31- ```
32-
33- ## Quick examples
34-
35- ``` bash
36- # OpenAPI generation
37- npx qraft openapi --plugin tanstack-query-react --plugin openapi-typescript ./openapi.yaml -o ./src/api
38-
39- # AsyncAPI generation
40- npx qraft asyncapi --plugin asyncapi-typescript ./asyncapi.yaml -o ./src/events
41-
42- # Generate from redocly.yaml (both x-openapi-qraft + x-asyncapi-qraft)
43- npx qraft redocly
44- ```
15+ This lets you use one CLI package and one binary (` qraft ` ) for both OpenAPI and AsyncAPI schemas.
4516
4617## Detailed docs
4718
Original file line number Diff line number Diff line change 11---
22sidebar_position : 2
3- sidebar_label : OpenAPI CLI
3+ sidebar_label : OpenAPI
44---
55
66import Tabs from ' @theme/Tabs' ;
@@ -9,7 +9,7 @@ import TabItem from '@theme/TabItem';
99# OpenAPI mode (` qraft openapi ` )
1010
1111` qraft openapi ` is the OpenAPI-focused mode of the unified ` @qraft/cli ` package.
12- It generates API schemas and interfaces for ` @openapi-qraft/react ` and keeps the existing OpenAPI generation flow fully compatible .
12+ It generates code from OpenAPI documents using OpenAPI plugins, including React services and TypeScript schema types .
1313
1414Qraft relies on types from the generation result of [ ` openapi-typescript ` ] ( https://www.npmjs.com/package/openapi-typescript ) package,
1515which is a powerful tool for generating types from an OpenAPI schema.
Original file line number Diff line number Diff line change 11---
2- sidebar_position : 2
2+ sidebar_position : 3
33sidebar_label : Redocly config support
44---
55
You can’t perform that action at this time.
0 commit comments