The AsyncAPI CLI makes it easier to work with AsyncAPI documents.
Usage
1$ npm install -g @asyncapi/cli
2$ asyncapi COMMAND
3running command...
4$ asyncapi (--version|--v)
5@asyncapi/cli/5.0.1 darwin-arm64 node-v22.16.0
6$ asyncapi --help [COMMAND]
7USAGE
8 $ asyncapi COMMAND
9...Commands
asyncapi autocomplete [SHELL]asyncapi bundleasyncapi configasyncapi config analyticsasyncapi config auth add PATTERN TOKENasyncapi config contextasyncapi config context add CONTEXT-NAME SPEC-FILE-PATHasyncapi config context currentasyncapi config context edit CONTEXT-NAME NEW-SPEC-FILE-PATHasyncapi config context init [CONTEXT-FILE-PATH]asyncapi config context listasyncapi config context remove CONTEXT-NAMEasyncapi config context use CONTEXT-NAMEasyncapi config versionsasyncapi convert [SPEC-FILE]asyncapi diff OLD NEWasyncapi format [SPEC-FILE]asyncapi generateasyncapi generate client LANGUAGE [ASYNCAPI]asyncapi generate fromTemplate [ASYNCAPI] [TEMPLATE]asyncapi generate models LANGUAGE FILEasyncapi newasyncapi new fileasyncapi new templateasyncapi optimize [SPEC-FILE]asyncapi pretty SPEC-FILEasyncapi startasyncapi start apiasyncapi start preview SPEC-FILEasyncapi start studio [SPEC-FILE]asyncapi validate [SPEC-FILE]
asyncapi autocomplete [SHELL]
Display autocomplete installation instructions.
1USAGE
2 $ asyncapi autocomplete [SHELL] [-r]
3
4ARGUMENTS
5 [SHELL] (zsh|bash|powershell) Shell type
6
7FLAGS
8 -r, --refresh-cache Refresh cache (ignores displaying instructions)
9
10DESCRIPTION
11 Display autocomplete installation instructions.
12
13EXAMPLES
14 $ asyncapi autocomplete
15
16 $ asyncapi autocomplete bash
17
18 $ asyncapi autocomplete zsh
19
20 $ asyncapi autocomplete powershell
21
22 $ asyncapi autocomplete --refresh-cacheSee code: @oclif/plugin-autocomplete
asyncapi bundle
Bundle one or multiple AsyncAPI Documents and their references together.
1USAGE
2 $ asyncapi bundle [-h] [-o <value>] [-b <value>] [-d <value>] [-x]
3
4FLAGS
5 -b, --base=<value> Path to the file which will act as a base. This is required when some properties need to be
6 overwritten.
7 -d, --baseDir=<value> One relative/absolute path to directory relative to which paths to AsyncAPI Documents that
8 should be bundled will be resolved.
9 -h, --help Show CLI help.
10 -o, --output=<value> The output file name. Omitting this flag the result will be printed in the console.
11 -x, --xOrigin Pass this switch to generate properties "x-origin" that will contain historical values of
12 dereferenced "$ref"s.
13
14DESCRIPTION
15 Bundle one or multiple AsyncAPI Documents and their references together.
16
17EXAMPLES
18 $ asyncapi bundle ./asyncapi.yaml > final-asyncapi.yaml
19
20 $ asyncapi bundle ./asyncapi.yaml --output final-asyncapi.yaml
21
22 $ asyncapi bundle ./asyncapi.yaml ./features.yaml
23
24 $ asyncapi bundle ./asyncapi.yaml ./features.yaml --base ./main.yaml
25
26 $ asyncapi bundle ./asyncapi.yaml ./features.yaml --base ./main.yaml --xOrigin
27
28 $ asyncapi bundle ./asyncapi.yaml -o final-asyncapi.yaml --base ../public-api/main.yaml --baseDir ./social-media/comments-serviceSee code: src/commands/bundle.ts
asyncapi config
CLI config settings
1USAGE
2 $ asyncapi config
3
4DESCRIPTION
5 CLI config settingsSee code: src/commands/config/index.ts
asyncapi config analytics
Enable or disable analytics for metrics collection
1USAGE
2 $ asyncapi config analytics [-h] [-d] [-e] [-s]
3
4FLAGS
5 -d, --disable disable analytics
6 -e, --enable enable analytics
7 -h, --help Show CLI help.
8 -s, --status show current status of analytics
9
10DESCRIPTION
11 Enable or disable analytics for metrics collectionSee code: src/commands/config/analytics.ts
asyncapi config auth add PATTERN TOKEN
Add an authentication config for resolving $ref files requiring HTTP Authorization.
1USAGE
2 $ asyncapi config auth add PATTERN TOKEN [-a <value>] [-h <value>...]
3
4ARGUMENTS
5 PATTERN Glob pattern for matching protected URLs (e.g. github.com/org/repo/**/*.*)
6 TOKEN Authentication token or environment variable reference (prefix with $, e.g. $GITHUB_TOKEN)
7
8FLAGS
9 -a, --auth-type=<value> Authentication type (default is "Bearer")
10 -h, --header=<value>... Additional header in key=value format; can be used multiple times
11
12DESCRIPTION
13 Add an authentication config for resolving $ref files requiring HTTP Authorization.See code: src/commands/config/auth/add.ts
asyncapi config context
Manage short aliases for full paths to AsyncAPI documents
1USAGE
2 $ asyncapi config context
3
4DESCRIPTION
5 Manage short aliases for full paths to AsyncAPI documentsSee code: src/commands/config/context/index.ts
asyncapi config context add CONTEXT-NAME SPEC-FILE-PATH
Add a context to the store
1USAGE
2 $ asyncapi config context add CONTEXT-NAME SPEC-FILE-PATH [-h] [-s]
3
4ARGUMENTS
5 CONTEXT-NAME context name
6 SPEC-FILE-PATH file path of the spec file
7
8FLAGS
9 -h, --help Show CLI help.
10 -s, --set-current Set context being added as the current context
11
12DESCRIPTION
13 Add a context to the storeSee code: src/commands/config/context/add.ts
asyncapi config context current
Shows the current context that is being used
1USAGE
2 $ asyncapi config context current [-h]
3
4FLAGS
5 -h, --help Show CLI help.
6
7DESCRIPTION
8 Shows the current context that is being usedSee code: src/commands/config/context/current.ts
asyncapi config context edit CONTEXT-NAME NEW-SPEC-FILE-PATH
Edit a context in the store
1USAGE
2 $ asyncapi config context edit CONTEXT-NAME NEW-SPEC-FILE-PATH [-h]
3
4ARGUMENTS
5 CONTEXT-NAME context name
6 NEW-SPEC-FILE-PATH file path of the spec file
7
8FLAGS
9 -h, --help Show CLI help.
10
11DESCRIPTION
12 Edit a context in the storeSee code: src/commands/config/context/edit.ts
asyncapi config context init [CONTEXT-FILE-PATH]
Initialize context
1USAGE
2 $ asyncapi config context init [CONTEXT-FILE-PATH] [-h]
3
4ARGUMENTS
5 [CONTEXT-FILE-PATH] Specify directory in which context file should be created:
6 - current directory : asyncapi config context init .(default)
7 - root of current repository : asyncapi config context init ./
8 - user's home directory : asyncapi config context init ~`
9
10FLAGS
11 -h, --help Show CLI help.
12
13DESCRIPTION
14 Initialize contextSee code: src/commands/config/context/init.ts
asyncapi config context list
List all the stored contexts in the store
1USAGE
2 $ asyncapi config context list [-h]
3
4FLAGS
5 -h, --help Show CLI help.
6
7DESCRIPTION
8 List all the stored contexts in the storeSee code: src/commands/config/context/list.ts
asyncapi config context remove CONTEXT-NAME
Delete a context from the store
1USAGE
2 $ asyncapi config context remove CONTEXT-NAME [-h]
3
4ARGUMENTS
5 CONTEXT-NAME Name of the context to delete
6
7FLAGS
8 -h, --help Show CLI help.
9
10DESCRIPTION
11 Delete a context from the storeSee code: src/commands/config/context/remove.ts
asyncapi config context use CONTEXT-NAME
Set a context as current
1USAGE
2 $ asyncapi config context use CONTEXT-NAME [-h]
3
4ARGUMENTS
5 CONTEXT-NAME name of the saved context
6
7FLAGS
8 -h, --help Show CLI help.
9
10DESCRIPTION
11 Set a context as currentSee code: src/commands/config/context/use.ts
asyncapi config versions
Show versions of AsyncAPI tools used
1USAGE
2 $ asyncapi config versions [-h]
3
4FLAGS
5 -h, --help Show CLI help.
6
7DESCRIPTION
8 Show versions of AsyncAPI tools usedSee code: src/commands/config/versions.ts
asyncapi convert [SPEC-FILE]
Convert asyncapi documents older to newer versions or OpenAPI/postman-collection documents to AsyncAPI
1USAGE
2 $ asyncapi convert [SPEC-FILE] -f openapi|asyncapi|postman-collection [-h] [-o <value>] [-t <value>] [-p
3 client|server] [--proxyHost <value>] [--proxyPort <value>]
4
5ARGUMENTS
6 [SPEC-FILE] spec path, url, or context-name
7
8FLAGS
9 -f, --format=<option> (required) [default: asyncapi] Specify the format to convert from (openapi or asyncapi)
10 <options: openapi|asyncapi|postman-collection>
11 -h, --help Show CLI help.
12 -o, --output=<value> path to the file where the result is saved
13 -p, --perspective=<option> [default: server] Perspective to use when converting OpenAPI to AsyncAPI (client or
14 server). Note: This option is only applicable for OpenAPI to AsyncAPI conversions.
15 <options: client|server>
16 -t, --target-version=<value> [default: 3.0.0] asyncapi version to convert to
17 --proxyHost=<value> Name of the ProxyHost
18 --proxyPort=<value> Port number number for the proxyHost.
19
20DESCRIPTION
21 Convert asyncapi documents older to newer versions or OpenAPI/postman-collection documents to AsyncAPISee code: src/commands/convert.ts
asyncapi diff OLD NEW
Find diff between two asyncapi files
1USAGE
2 $ asyncapi diff OLD NEW [-h] [-f json|yaml|yml|md] [-t breaking|non-breaking|unclassified|all]
3 [--markdownSubtype json|yaml|yml] [-o <value>] [--no-error] [-w] [--log-diagnostics] [--diagnostics-format
4 json|stylish|junit|html|text|teamcity|pretty] [--fail-severity error|warn|info|hint] [-s <value>]
5
6ARGUMENTS
7 OLD old spec path, URL or context-name
8 NEW new spec path, URL or context-name
9
10FLAGS
11 -f, --format=<option> [default: yaml] format of the output
12 <options: json|yaml|yml|md>
13 -h, --help Show CLI help.
14 -o, --overrides=<value> path to JSON file containing the override properties
15 -s, --save-output=<value> The output file name. Omitting this flag the result will be printed in the console.
16 -t, --type=<option> [default: all] type of the output
17 <options: breaking|non-breaking|unclassified|all>
18 -w, --watch Enable watch mode
19 --diagnostics-format=<option> [default: stylish] format to use for validation diagnostics
20 <options: json|stylish|junit|html|text|teamcity|pretty>
21 --fail-severity=<option> [default: error] diagnostics of this level or above will trigger a failure exit
22 code
23 <options: error|warn|info|hint>
24 --[no-]log-diagnostics log validation diagnostics or not
25 --markdownSubtype=<option> the format of changes made to AsyncAPI document. It works only when diff is
26 generated using md type. For example, when you specify subtype as json, then diff
27 information in markdown is dumped as json structure.
28 <options: json|yaml|yml>
29 --no-error don't show error on breaking changes
30
31DESCRIPTION
32 Find diff between two asyncapi filesSee code: src/commands/diff.ts
asyncapi format [SPEC-FILE]
Convert asyncapi documents from any format to yaml, yml or JSON
1USAGE
2 $ asyncapi format [SPEC-FILE] -f yaml|yml|json [-h] [-o <value>]
3
4ARGUMENTS
5 [SPEC-FILE] spec path, url, or context-name
6
7FLAGS
8 -f, --format=<option> (required) [default: json] Specify the format to convert to
9 <options: yaml|yml|json>
10 -h, --help Show CLI help.
11 -o, --output=<value> path to the file where the result is saved
12
13DESCRIPTION
14 Convert asyncapi documents from any format to yaml, yml or JSONSee code: src/commands/format.ts
asyncapi generate
Generate typed models or other things like clients, applications or docs using AsyncAPI Generator templates.
1USAGE
2 $ asyncapi generate
3
4DESCRIPTION
5 Generate typed models or other things like clients, applications or docs using AsyncAPI Generator templates.See code: src/commands/generate/index.ts
asyncapi generate client LANGUAGE [ASYNCAPI]
Generates clients baked-in AsyncAPI Generator. Available for: dart, java, javascript, python. If some language is not supported or you want to improve existing client, join us at https://github.com/asyncapi/generator
1USAGE
2 $ asyncapi generate client LANGUAGE [ASYNCAPI] [-h] [-d <value>...] [--no-interactive] [-i] [--debug] [-n
3 <value>...] [-o <value>] [--force-write] [-w] [-p <value>...] [--map-base-url <value>] [--registry-url <value>]
4 [--registry-auth <value>] [--registry-token <value>] [--proxyHost <value>] [--proxyPort <value>]
5
6ARGUMENTS
7 LANGUAGE The language you want the client generated for. Available target languages: dart, java, javascript, python
8 [ASYNCAPI] - Local path, url or context-name pointing to AsyncAPI file
9
10FLAGS
11 -d, --disable-hook=<value>... Disable a specific hook type or hooks from a given hook type
12 -h, --help Show CLI help.
13 -i, --install Installs the template and its dependencies (defaults to false)
14 -n, --no-overwrite=<value>... Glob or path of the file(s) to skip when regenerating
15 -o, --output=<value> Directory where to put the generated files (defaults to current directory)
16 -p, --param=<value>... Additional param to pass to templates
17 -w, --watch Watches the template directory and the AsyncAPI document, and re-generate the files
18 when changes occur. Ignores the output directory.
19 --debug Enable more specific errors in the console
20 --force-write Force writing of the generated files to given directory even if it is a git repo with
21 unstaged files or not empty dir (defaults to false)
22 --map-base-url=<value> Maps all schema references from base url to local folder
23 --no-interactive Disable interactive mode and run with the provided flags.
24 --proxyHost=<value> Name of the ProxyHost
25 --proxyPort=<value> Port number number for the proxyHost.
26 --registry-auth=<value> The registry username and password encoded with base64, formatted as username:password
27 --registry-token=<value> The npm registry authentication token, that can be passed instead of base64 encoded
28 username and password
29 --registry-url=<value> [default: https://registry.npmjs.org] Specifies the URL of the private registry for
30 fetching templates and dependencies
31
32DESCRIPTION
33 Generates clients baked-in AsyncAPI Generator. Available for: dart, java, javascript, python. If some language is not
34 supported or you want to improve existing client, join us at https://github.com/asyncapi/generator
35
36EXAMPLES
37 $ asyncapi generate client javascript asyncapi.yaml --param version=1.0.0 singleFile=true --output ./docs --force-writeSee code: src/commands/generate/client.ts
asyncapi generate fromTemplate [ASYNCAPI] [TEMPLATE]
Generates whatever you want using templates compatible with AsyncAPI Generator.
1USAGE
2 $ asyncapi generate fromTemplate [ASYNCAPI] [TEMPLATE] [-h] [-d <value>...] [--no-interactive] [-i] [--debug] [-n
3 <value>...] [-o <value>] [--force-write] [-w] [-p <value>...] [--map-base-url <value>] [--registry-url <value>]
4 [--registry-auth <value>] [--registry-token <value>] [--proxyHost <value>] [--proxyPort <value>]
5
6ARGUMENTS
7 [ASYNCAPI] - Local path, url or context-name pointing to AsyncAPI file
8 [TEMPLATE] - Name of the generator template like for example @asyncapi/html-template or
9 https://github.com/asyncapi/html-template
10
11FLAGS
12 -d, --disable-hook=<value>... Disable a specific hook type or hooks from a given hook type
13 -h, --help Show CLI help.
14 -i, --install Installs the template and its dependencies (defaults to false)
15 -n, --no-overwrite=<value>... Glob or path of the file(s) to skip when regenerating
16 -o, --output=<value> Directory where to put the generated files (defaults to current directory)
17 -p, --param=<value>... Additional param to pass to templates
18 -w, --watch Watches the template directory and the AsyncAPI document, and re-generate the files
19 when changes occur. Ignores the output directory.
20 --debug Enable more specific errors in the console
21 --force-write Force writing of the generated files to given directory even if it is a git repo with
22 unstaged files or not empty dir (defaults to false)
23 --map-base-url=<value> Maps all schema references from base url to local folder
24 --no-interactive Disable interactive mode and run with the provided flags.
25 --proxyHost=<value> Name of the ProxyHost
26 --proxyPort=<value> Port number number for the proxyHost.
27 --registry-auth=<value> The registry username and password encoded with base64, formatted as username:password
28 --registry-token=<value> The npm registry authentication token, that can be passed instead of base64 encoded
29 username and password
30 --registry-url=<value> [default: https://registry.npmjs.org] Specifies the URL of the private registry for
31 fetching templates and dependencies
32
33DESCRIPTION
34 Generates whatever you want using templates compatible with AsyncAPI Generator.
35
36EXAMPLES
37 $ asyncapi generate fromTemplate asyncapi.yaml @asyncapi/html-template --param version=1.0.0 singleFile=true --output ./docs --force-writeSee code: src/commands/generate/fromTemplate.ts
asyncapi generate models LANGUAGE FILE
Generates typed models
1USAGE
2 $ asyncapi generate models LANGUAGE FILE [-h] [-o <value>] [--packageName <value>] [--namespace <value>]
3 [--tsModelType class|interface] [--tsEnumType enum|union] [--tsModuleSystem ESM|CJS] [--tsIncludeComments]
4 [--tsExportType default|named] [--tsJsonBinPack] [--tsMarshalling] [--tsExampleInstance] [--tsRawPropertyNames]
5 [--csharpAutoImplement] [--csharpNewtonsoft] [--csharpArrayType Array|List] [--csharpHashcode] [--csharpEqual]
6 [--csharpSystemJson] [--goIncludeComments] [--goIncludeTags] [--javaIncludeComments] [--javaJackson]
7 [--javaConstraints] [--javaArrayType Array|List] [--pyDantic] [--no-interactive] [--log-diagnostics]
8 [--diagnostics-format json|stylish|junit|html|text|teamcity|pretty] [--fail-severity error|warn|info|hint] [-s
9 <value>] [--proxyHost <value>] [--proxyPort <value>]
10
11ARGUMENTS
12 LANGUAGE (typescript|csharp|golang|java|javascript|dart|python|rust|kotlin|php|cplusplus|scala) The language you want
13 the typed models generated for.
14 FILE Path or URL to the AsyncAPI document, or context-name
15
16FLAGS
17 -h, --help Show CLI help.
18 -o, --output=<value> The output directory where the models should be written to. Omitting this flag will
19 write the models to `stdout`.
20 -s, --save-output=<value> The output file name. Omitting this flag the result will be printed in the console.
21 --csharpArrayType=<option> [default: Array] C# specific, define which type of array needs to be generated.
22 <options: Array|List>
23 --csharpAutoImplement C# specific, define whether to generate auto-implemented properties or not.
24 --csharpEqual C# specific, generate the models with the Equal method overwritten
25 --csharpHashcode C# specific, generate the models with the GetHashCode method overwritten
26 --csharpNewtonsoft C# specific, generate the models with newtonsoft serialization support
27 --csharpSystemJson C# specific, generate the models with System.Text.Json serialization support
28 --diagnostics-format=<option> [default: stylish] format to use for validation diagnostics
29 <options: json|stylish|junit|html|text|teamcity|pretty>
30 --fail-severity=<option> [default: error] diagnostics of this level or above will trigger a failure exit
31 code
32 <options: error|warn|info|hint>
33 --goIncludeComments Golang specific, if enabled add comments while generating models.
34 --goIncludeTags Golang specific, if enabled add tags while generating models.
35 --javaArrayType=<option> [default: Array] Java specific, define which type of array needs to be generated.
36 <options: Array|List>
37 --javaConstraints Java specific, generate the models with constraints
38 --javaIncludeComments Java specific, if enabled add comments while generating models.
39 --javaJackson Java specific, generate the models with Jackson serialization support
40 --[no-]log-diagnostics log validation diagnostics or not
41 --namespace=<value> C#, C++ and PHP specific, define the namespace to use for the generated models.
42 This is required when language is `csharp`,`c++` or `php`.
43 --no-interactive Disable interactive mode and run with the provided flags.
44 --packageName=<value> Go, Java and Kotlin specific, define the package to use for the generated models.
45 This is required when language is `go`, `java` or `kotlin`.
46 --proxyHost=<value> Name of the ProxyHost
47 --proxyPort=<value> Port number number for the proxyHost.
48 --pyDantic Python specific, generate the Pydantic models.
49 --tsEnumType=<option> [default: enum] TypeScript specific, define which type of enums needs to be
50 generated.
51 <options: enum|union>
52 --tsExampleInstance Typescript specific, generate example of the model.
53 --tsExportType=<option> [default: default] TypeScript specific, define which type of export needs to be
54 generated.
55 <options: default|named>
56 --tsIncludeComments TypeScript specific, if enabled add comments while generating models.
57 --tsJsonBinPack TypeScript specific, define basic support for serializing to and from binary with
58 jsonbinpack.
59 --tsMarshalling TypeScript specific, generate the models with marshalling functions.
60 --tsModelType=<option> [default: class] TypeScript specific, define which type of model needs to be
61 generated.
62 <options: class|interface>
63 --tsModuleSystem=<option> [default: ESM] TypeScript specific, define the module system to be used.
64 <options: ESM|CJS>
65 --tsRawPropertyNames Typescript specific, generate the models using raw property names.
66
67DESCRIPTION
68 Generates typed modelsSee code: src/commands/generate/models.ts
asyncapi new
Create a new AsyncAPI project, specification files, or templates for clients and applications.
1USAGE
2 $ asyncapi new
3
4DESCRIPTION
5 Create a new AsyncAPI project, specification files, or templates for clients and applications.See code: src/commands/new/index.ts
asyncapi new file
Creates a new asyncapi file
1USAGE
2 $ asyncapi new file [-h] [-n <value>] [-e <value>] [-s] [-p <value>] [--no-tty]
3
4FLAGS
5 -e, --example=<value>
6 name of the example to use. Available examples are:
7 - simple-asyncapi.yml
8 - adeo-kafka-request-reply-asyncapi.yml
9 - anyof-asyncapi.yml
10 - application-headers-asyncapi.yml
11 - correlation-id-asyncapi.yml
12 - websocket-gemini-asyncapi.yml
13 - gitter-streaming-asyncapi.yml
14 - kraken-websocket-request-reply-message-filter-in-reply-asyncapi.yml
15 - kraken-websocket-request-reply-multiple-channels-asyncapi.yml
16 - mercure-asyncapi.yml
17 - not-asyncapi.yml
18 - operation-security-asyncapi.yml
19 - oneof-asyncapi.yml
20 - rpc-client-asyncapi.yml
21 - rpc-server-asyncapi.yml
22 - slack-rtm-asyncapi.yml
23 - tutorial.yml
24 - streetlights-kafka-asyncapi.yml
25 - streetlights-operation-security-asyncapi.yml
26 - streetlights-mqtt-asyncapi.yml
27
28 -h, --help
29 Show CLI help.
30
31 -n, --file-name=<value>
32 name of the file
33
34 -p, --port=<value>
35 port in which to start Studio
36
37 -s, --studio
38 open in Studio
39
40 --no-tty
41 do not use an interactive terminal
42
43DESCRIPTION
44 Creates a new asyncapi file
45
46EXAMPLES
47 $ asyncapi new - start creation of a file in interactive mode
48
49 $ asyncapi new --file-name=my-asyncapi.yaml --example=default-example.yaml --no-tty - create a new file with a specific name, using one of the examples and without interactive modeSee code: src/commands/new/file.ts
asyncapi new template
Creates a new template
1USAGE
2 $ asyncapi new template [-h] [-n <value>] [-t <value>] [-f <value>] [--force-write]
3
4FLAGS
5 -f, --file=<value> The path to the AsyncAPI file for generating a template.
6 -h, --help Show CLI help.
7 -n, --name=<value> [default: project] Name of the Project
8 -t, --template=<value> [default: default] Name of the Template
9 --force-write Force writing of the generated files to given directory even if it is a git repo with unstaged
10 files or not empty dir (defaults to false)
11
12DESCRIPTION
13 Creates a new templateSee code: src/commands/new/template.ts
asyncapi optimize [SPEC-FILE]
optimize asyncapi specification file
1USAGE
2 $ asyncapi optimize [SPEC-FILE] [-h] [-p
3 remove-components|reuse-components|move-duplicates-to-components|move-all-to-components...] [-i schema...] [-o
4 terminal|new-file|overwrite] [--no-tty] [--proxyHost <value>] [--proxyPort <value>]
5
6ARGUMENTS
7 [SPEC-FILE] spec path, url, or context-name
8
9FLAGS
10 -h, --help Show CLI help.
11 -i, --ignore=<option>... [default: ] list of components to be ignored from the optimization process
12 <options: schema>
13 -o, --output=<option> [default: terminal] select where you want the output.
14 <options: terminal|new-file|overwrite>
15 -p, --optimization=<option>... [default: remove-components,reuse-components,move-duplicates-to-components,move-all-to
16 -components] select the type of optimizations that you want to apply.
17 <options: remove-components|reuse-components|move-duplicates-to-components|move-all-to
18 -components>
19 --no-tty do not use an interactive terminal
20 --proxyHost=<value> Name of the ProxyHost
21 --proxyPort=<value> Port number number for the proxyHost.
22
23DESCRIPTION
24 optimize asyncapi specification file
25
26EXAMPLES
27 $ asyncapi optimize ./asyncapi.yaml
28
29 $ asyncapi optimize ./asyncapi.yaml --no-tty
30
31 $ asyncapi optimize ./asyncapi.yaml --optimization=remove-components --optimization=reuse-components --optimization=move-all-to-components --no-tty
32
33 $ asyncapi optimize ./asyncapi.yaml --optimization=remove-components --output=terminal --no-tty
34
35 $ asyncapi optimize ./asyncapi.yaml --ignore=schemaSee code: src/commands/optimize.ts
asyncapi pretty SPEC-FILE
Beautify the AsyncAPI spec file (indentation, styling) in place or output the formatted spec to a new file.
1USAGE
2 $ asyncapi pretty SPEC-FILE [-o <value>]
3
4ARGUMENTS
5 SPEC-FILE spec path, url, or context-name
6
7FLAGS
8 -o, --output=<value> Output file path
9
10DESCRIPTION
11 Beautify the AsyncAPI spec file (indentation, styling) in place or output the formatted spec to a new file.
12
13EXAMPLES
14 $ asyncapi pretty ./asyncapi.yaml
15
16 $ asyncapi pretty ./asyncapi.yaml --output formatted-asyncapi.yamlSee code: src/commands/pretty.ts
asyncapi start
Starts AsyncAPI-related services. Currently, it supports launching the AsyncAPI Studio
1USAGE
2 $ asyncapi start
3
4DESCRIPTION
5 Starts AsyncAPI-related services. Currently, it supports launching the AsyncAPI StudioSee code: src/commands/start/index.ts
asyncapi start api
starts the AsyncAPI server API.
1USAGE
2 $ asyncapi start api [-h] [-m development|production|test] [-p <value>]
3
4FLAGS
5 -h, --help Show CLI help.
6 -m, --mode=<option> [default: production] mode in which to start the API
7 <options: development|production|test>
8 -p, --port=<value> port in which to start the API
9
10DESCRIPTION
11 starts the AsyncAPI server API.See code: src/commands/start/api.ts
asyncapi start preview SPEC-FILE
starts a new local instance of Studio in minimal state bundling all the refs of the schema file and with no editing allowed.
1USAGE
2 $ asyncapi start preview SPEC-FILE [-h] [-p <value>] [-b <value>] [-d <value>] [-x] [-l] [-B]
3
4ARGUMENTS
5 SPEC-FILE the path to the file to be opened with studio or context name
6
7FLAGS
8 -B, --noBrowser Pass this to not open browser automatically upon running the command
9 -b, --base=<value> Path to the file which will act as a base. This is required when some properties need to be
10 overwritten while bundling with the file.
11 -d, --baseDir=<value> One relative/absolute path to directory relative to which paths to AsyncAPI Documents that
12 should be bundled will be resolved.
13 -h, --help Show CLI help.
14 -l, --suppressLogs Pass this to suppress the detiled error logs.
15 -p, --port=<value> port in which to start Studio in the preview mode
16 -x, --xOrigin Pass this switch to generate properties "x-origin" that will contain historical values of
17 dereferenced "$ref"s.
18
19DESCRIPTION
20 starts a new local instance of Studio in minimal state bundling all the refs of the schema file and with no editing
21 allowed.See code: src/commands/start/preview.ts
asyncapi start studio [SPEC-FILE]
starts a new local instance of Studio
1USAGE
2 $ asyncapi start studio [SPEC-FILE] [-h] [-f <value>] [-p <value>] [--no-interactive] [-B]
3
4ARGUMENTS
5 [SPEC-FILE] spec path, url, or context-name
6
7FLAGS
8 -B, --noBrowser Pass this to not open browser automatically upon running the command
9 -f, --file=<value> path to the AsyncAPI file to link with Studio
10 -h, --help Show CLI help.
11 -p, --port=<value> port in which to start Studio
12 --no-interactive disable prompts for this command which asks for file path if not passed via the arguments.
13
14DESCRIPTION
15 starts a new local instance of StudioSee code: src/commands/start/studio.ts
asyncapi validate [SPEC-FILE]
validate asyncapi file
1USAGE
2 $ asyncapi validate [SPEC-FILE] [-h] [-w] [--log-diagnostics] [--diagnostics-format
3 json|stylish|junit|html|text|teamcity|pretty] [--fail-severity error|warn|info|hint] [-s <value>] [--score]
4 [--suppressWarnings <value>...] [--suppressAllWarnings] [--proxyHost <value>] [--proxyPort <value>]
5
6ARGUMENTS
7 [SPEC-FILE] spec path, url, or context-name
8
9FLAGS
10 -h, --help Show CLI help.
11 -s, --save-output=<value> The output file name. Omitting this flag the result will be printed in the console.
12 -w, --watch Enable watch mode
13 --diagnostics-format=<option> [default: stylish] format to use for validation diagnostics
14 <options: json|stylish|junit|html|text|teamcity|pretty>
15 --fail-severity=<option> [default: error] diagnostics of this level or above will trigger a failure exit
16 code
17 <options: error|warn|info|hint>
18 --[no-]log-diagnostics log validation diagnostics or not
19 --proxyHost=<value> Name of the ProxyHost
20 --proxyPort=<value> Port number number for the proxyHost.
21 --score Compute the score of the AsyncAPI document. Scoring is based on whether the
22 document has description, license, server and/or channels.
23 --suppressAllWarnings Suppress all warnings from the validation output.
24 --suppressWarnings=<value>... List of warning codes to suppress from the validation output.
25
26DESCRIPTION
27 validate asyncapi fileSee code: src/commands/validate.ts