Skip to content

Commit ad89ba1

Browse files
committed
docs: reorganize and simplify CLI documentation structure for better navigation
1 parent 7e6957f commit ad89ba1

4 files changed

Lines changed: 11 additions & 46 deletions

File tree

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
sidebar_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
2323
npx 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
3535
npx qraft asyncapi --plugin asyncapi-typescript ./asyncapi.yaml -o ./src/events
3636
```
3737

@@ -52,14 +52,8 @@ apis:
5252
5353
Then run:
5454
55-
```bash
55+
```bash npm2yarn
5656
npx qraft asyncapi --redocly
5757
# or generate both OpenAPI + AsyncAPI entries
5858
npx 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.

website/docs/codegen/CLI/cli.mdx

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,10 @@ sidebar_label: CLI overview
99

1010
It 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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
sidebar_position: 2
3-
sidebar_label: OpenAPI CLI
3+
sidebar_label: OpenAPI
44
---
55

66
import 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

1414
Qraft relies on types from the generation result of [`openapi-typescript`](https://www.npmjs.com/package/openapi-typescript) package,
1515
which is a powerful tool for generating types from an OpenAPI schema.

website/docs/codegen/CLI/redocly-config.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 2
2+
sidebar_position: 3
33
sidebar_label: Redocly config support
44
---
55

0 commit comments

Comments
 (0)