Skip to content

Commit 7e6957f

Browse files
committed
docs: update CLI documentation to reflect unified Qraft CLI and AsyncAPI mode
1 parent d869503 commit 7e6957f

5 files changed

Lines changed: 371 additions & 245 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
sidebar_position: 3
3+
sidebar_label: AsyncAPI CLI
4+
---
5+
6+
# AsyncAPI mode (`qraft asyncapi`)
7+
8+
`qraft asyncapi` is the AsyncAPI-focused mode of `@qraft/cli`.
9+
10+
It uses AsyncAPI-compatible plugins and currently supports built-in generation with:
11+
12+
- `asyncapi-typescript``@qraft/asyncapi-typescript-plugin`
13+
14+
## Installation
15+
16+
```bash npm2yarn
17+
npm install -D @qraft/cli @qraft/asyncapi-typescript-plugin
18+
```
19+
20+
## Usage
21+
22+
```bash
23+
npx qraft asyncapi --plugin asyncapi-typescript ./asyncapi.yaml --output-dir src/events
24+
```
25+
26+
## Required options
27+
28+
- **`-o <path>, --output-dir <path>`** — output directory for generated files.
29+
30+
## Plugin selection
31+
32+
Unlike legacy CLI flows where defaults could be implied, `qraft asyncapi` requires explicit plugin selection:
33+
34+
```bash
35+
npx qraft asyncapi --plugin asyncapi-typescript ./asyncapi.yaml -o ./src/events
36+
```
37+
38+
## Redocly config support
39+
40+
AsyncAPI generation can be configured in `redocly.yaml` via `x-asyncapi-qraft`:
41+
42+
```yaml
43+
apis:
44+
events:
45+
root: ./asyncapi.yaml
46+
x-asyncapi-qraft:
47+
plugin:
48+
asyncapi-typescript: true
49+
output-dir: src/events
50+
clean: true
51+
```
52+
53+
Then run:
54+
55+
```bash
56+
npx qraft asyncapi --redocly
57+
# or generate both OpenAPI + AsyncAPI entries
58+
npx qraft redocly
59+
```
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.

0 commit comments

Comments
 (0)