Skip to content

Commit

Permalink
update as per review
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmohona committed Jul 25, 2023
1 parent f2f7f13 commit ab6d277
Showing 1 changed file with 39 additions and 33 deletions.
72 changes: 39 additions & 33 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ weight: 20
---


The AsyncAPI CLI is a command-line tool that provides developers with a set of commands for working with AsyncAPI documents. AsyncAPI is a specification for describing asynchronous APIs, which allows developers to define the structure of messages exchanged between different parts of their application. The AsyncAPI CLI simplifies the process of creating, validating, and manipulating AsyncAPI documents, making it easier to work with asynchronous APIs.
The AsyncAPI CLI is a command-line tool that provides developers with a set of commands for working with AsyncAPI documents. AsyncAPI is a specification for describing asynchronous APIs, which allows developers to define the structure of messages exchanged between different parts of their application. The AsyncAPI CLI simplifies the process of creating, validating, bundling, and manipulating AsyncAPI documents, making it easier to work with asynchronous APIs.

## Features

Expand All @@ -18,53 +18,59 @@ The AsyncAPI CLI offers the following key features:

* Difference: The AsyncAPI CLI can be used to find the differences between two AsyncAPI documents. This is useful for comparing different versions of an API or for identifying changes that have been made to an API.

* Generator: The AsyncAPI CLI includes a powerful tool called the Generator, which allows you to generate various types of documentation, applications, and models in different programming languages. The Generator leverages external libraries like [Generator](https:/asyncapi/generator) and [Modelina](https:/asyncapi/modelina) to automate the creation of new APIs, ensuring they follow best practices. This feature can save a significant amount of time and effort when creating new APIs.
* Generation: The AsyncAPI CLI leverages AsyncAPI libraries like [Generator](https:/asyncapi/generator) and [Modelina](https:/asyncapi/modelina), which allow you to generate various types of documentation, applications, and models in different programming languages. This feature can save a significant amount of time and effort when creating new APIs.

* Optimize: The AsyncAPI CLI can be used to optimize an AsyncAPI specification file. This can improve the performance of APIs and make them easier to understand.

* Start: The AsyncAPI CLI can be used to start AsyncAPI Studio. This is a web-based tool that can be used to view, edit, and test AsyncAPI documents.
* Optimize: Using [Optimizer](https:/asyncapi/optimizer/) the AsyncAPI CLI can be used to optimize an AsyncAPI specification file which can optimize structure of the AsyncAPI document to make it basically smaller and without repetition.

* Start: The AsyncAPI CLI can be used to start [AsyncAPI Studio](https://studio.asyncapi.com/) locally. This is a web-based tool that can be used to view, edit, and test AsyncAPI documents.

* Format Conversion: The AsyncAPI CLI offers seamless conversion of AsyncAPI documents between different formats, such as YAML and JSON, through integration with the [AsyncAPI Converter](https:/asyncapi/converter-js). This feature is helpful when working with tools that require a specific document format.

To summarize, the AsyncAPI CLI offers the following features and process flow, as shown in the diagram below:

```mermaid
graph TD;
A[AsyncAPI Document]
B[Validation]
C[Generator]
D[Creation]
E[Format Conversion]
F[Templates]
A-->|Validate|B;
A-->|Generate|C;
A-->|Create|D;
A-->|Convert|E;
A-->|Create with Templates|F;
A-->|Diff|H;
A-->|Optimize|I;
A-->|Start Studio|J;
B[Creation]
J[Studio - Editor]
I[Optimization]
D[Validation]
C[Generation]
F[Apps/Docs]
G[Models]
H[Diff]
K[Bundling]
E[Conversion]
A-->B;
A-->D;
A-->C;
C-->F
C-->G
A-->H;
A-->I;
A-->J;
A-->E;
A-->K;
```

## AsyncAPI CLI Flowchart
## CLI flow

The following flowchart illustrates the process flow of the AsyncAPI CLI:

```mermaid
graph TD
A[Start] --> B[User runs the AsyncAPI CLI]
B --> C[User runs a command]
C --> D[CLI processes command and runs corresponding operation]
D --> |Is operation successful?| E{Yes}
D --> |Is operation recoverable?| F{No}
E --> G[CLI returns results of operation to the user]
F --> H[CLI exits with an error message]
F --> |Suggests possible next steps to the user | I[CLI displays error message]
G --> J[User receives results]
H --> J
I --> J
J[End: User closes the AsyncAPI CLI]
graph TD;
A[Start] --> B[User runs the AsyncAPI CLI]
B --> C[User issues a command]
C --> D[CLI processes the command and runs the corresponding operation]
D --> |Is the operation successful?| E{Yes}
D --> |Is the operation recoverable?| F{Yes}
E --> G[CLI returns the results of the operation to the user]
F --> |Operation Error| H[CLI displays an error message and suggests possible next steps]
G --> J[User receives the results]
H --> I[User follows suggested steps to recover]
I --> C[User reissues the corrected command]
I --> J
J[User terminates the AsyncAPI CLI] --> K[End]
```

This flowchart shows the high-level process that occurs when using the AsyncAPI CLI. The user starts by running a command (such as `validate`, `generate`, or `start`), which is processed by the CLI. The CLI then performs the corresponding operation (such as validating or generating an AsyncAPI document), and returns the results to the user. If an error occurs, the CLI displays an error message and suggests possible next steps for the user to take.

0 comments on commit ab6d277

Please sign in to comment.