Skip to content

Commit

Permalink
docs: update readme files for CLI (#1902)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni authored Mar 18, 2024
1 parent 371f5cb commit 502682c
Show file tree
Hide file tree
Showing 2 changed files with 140 additions and 8 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
[![All Contributors](https://img.shields.io/badge/all_contributors-81-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->


Your one-stop tool for generating accurate and well-tested models for representing the message payloads. Use it as a tool in your development workflow, or a library in a larger integrations, entirely in your control.

---
Expand All @@ -21,7 +22,6 @@ Your one-stop tool for generating accurate and well-tested models for representi
<!-- toc -->

- [Installing Modelina](#installing-modelina)
- [AsyncAPI CLI](#asyncapi-cli)
- [Features](#features)
- [Requirements](#requirements)
- [Documentation](#documentation)
Expand All @@ -35,18 +35,16 @@ Your one-stop tool for generating accurate and well-tested models for representi

## Installing Modelina

Run this command to install Modelina in your project:
Install Modelina directly as a dependency to your project:

```bash
npm install @asyncapi/modelina
```

## AsyncAPI CLI

If you have the [AsyncAPI CLI installed](https://github.com/asyncapi/cli#installation) (ONLY support AsyncAPI inputs), you can run the following command to use [Modelina](https://github.com/asyncapi/cli#usage):
Or if you want to [run Modelina, use the CLI](./modelina-cli/README.md).

```bash
asyncapi generate models <language> ./asyncapi.json
modelina generate <language> ./asyncapi.json
```

<h2 align="center">What Does Modelina Do?</h2>
Expand Down
138 changes: 136 additions & 2 deletions modelina-cli/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,137 @@
# Modelina CLI
[![AsyncAPI Modelina](../docs/img/readme-banner.png)](https://www.modelina.org)
[![License](https://img.shields.io/github/license/asyncapi/modelina)](https://github.com/asyncapi/modelina/blob/master/LICENSE)
[![Npm latest version](https://img.shields.io/npm/v/@asyncapi/modelina-cli)](https://www.npmjs.com/package/@asyncapi/modelina-cli)
![NPM Downloads](https://img.shields.io/npm/dm/modelina-cli?label=npm)
![homebrew downloads](https://img.shields.io/homebrew/installs/dm/modelina?label=Brew)
![Chocolatey Downloads](https://img.shields.io/chocolatey/dt/modelina?label=Chocolatey)
![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/asyncapi/modelina/modelina.x64.pkg?label=MacOS)
![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/asyncapi/modelina/modelina.arm64.pkg?label=MacOS)
![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/asyncapi/modelina/modelina.x86.exe?label=Win)
![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/asyncapi/modelina/modelina.x64.exe?label=Win)
![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/asyncapi/modelina/modelina.tar.gz?label=Linux)
![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/asyncapi/modelina/modelina.deb?label=Linux)

A CLI for generating models using AsyncAPI Modelina.

---

> NOTICE: If you are only working exclusively with AsyncAPI documents, using the [AsyncAPI CLI is the preferred way to interact with Modelina](https://github.com/asyncapi/cli#installation) as it has the exact same features.
Here are all the ways you can install and run the Modelina CLI. For a full list of commands, [checkout the usage documentation](./docs/usage.md).

<h2 align="center">MacOS</h2>
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td>
<b><a href="https://brew.sh/">Brew</a></b>

```
brew install modelina
```
</td>
</tr>
<tr>
<td>
<b>MacOS x64</b>

Install it through dedicated `.pkg` file as a MacOS Application

```
# Download latest release
curl -OL https://github.com/asyncapi/modelina/releases/latest/download/modelina.x64.pkg
# Install it
sudo installer -pkg modelina.pkg -target /
```
</td>
</tr>
<tr>
<td>
<b>MacOS arm64</b>

Install it through dedicated `.pkg` file as a MacOS Application for arm64
```
# Download latest release
curl -OL https://github.com/asyncapi/modelina/releases/latest/download/modelina.arm64.pkg
# Install it
sudo installer -pkg modelina.pkg -target /
```
</td>
</tr>
</table>

<h2 align="center">Windows</h2>
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table style="width: 100%;">
<tr>
<td>
<b><a href="https://chocolatey.org/install">Chocolatey</a></b>

```
choco install modelina
```
</td>
</tr>
<tr>
<td><b>Windows x64</b>

Manually download and run [`modelina.x64.exe`](https://github.com/asyncapi/modelina/releases/latest/download/modelina.x64.exe)
</td>
</tr>
<tr>
<td>
<b>Windows x32</b>

Manually download and run the executable [`modelina.x86.exe`](https://github.com/asyncapi/modelina/releases/latest/download/modelina.x86.exe)
</td>
</tr>
</table>


<h2 align="center">Linux</h2>
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td><b>Debian</b>

```
# Download
curl -OL https://github.com/asyncapi/modelina/releases/latest/download/modelina.deb
# Install
sudo apt install ./modelina.deb
```
</td>
</tr>
<tr>
<td>
<b>Others</b>

```
# Download
curl -OL https://github.com/asyncapi/modelina/releases/latest/download/modelina.tar.gz
# Install
tar -xzf modelina.tar.gz
```

Remember to symlink the binaries `ln -s <absolute-path>/bin/modelina /user/local/bin/modelina` to access the CLI anywhere.
</td>
</tr>
</table>

<h2 align="center">Other ways</h2>
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table style="width: 100%;">
<tr>
<td>
<b>NPM</b>

```typescript
npm install -g @asyncapi/modelina-cli
```
</td>
</tr>
</table>

0 comments on commit 502682c

Please sign in to comment.