@asyncapi/cli 0.22.8 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -4
- package/oclif.manifest.json +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -6,8 +6,6 @@ CLI to work with your AsyncAPI files. Currently supports validation, but it is u
|
|
|
6
6
|
[](https://github.com/asyncapi/cli/actions/workflows/if-nodejs-pr-testing.yml)
|
|
7
7
|
[](https://www.npmjs.com/package/@asyncapi/cli)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
9
|
## Table of contents
|
|
12
10
|
|
|
13
11
|
<!-- toc -->
|
|
@@ -32,6 +30,7 @@ CLI to work with your AsyncAPI files. Currently supports validation, but it is u
|
|
|
32
30
|
To run `@asyncapi/cli`, you'll need Node.js >=v10
|
|
33
31
|
|
|
34
32
|
Run this terminal command to check your Node.js version:
|
|
33
|
+
|
|
35
34
|
```
|
|
36
35
|
node -v
|
|
37
36
|
```
|
|
@@ -39,6 +38,7 @@ node -v
|
|
|
39
38
|
> If you don't have Node.js installed or NPM, simply [install both via package manager](https://nodejs.org/en/download/package-manager/)
|
|
40
39
|
|
|
41
40
|
Install the CLI globaly on your system run CLI it from anywhere:
|
|
41
|
+
|
|
42
42
|
```
|
|
43
43
|
npm install -g @asyncapi/cli
|
|
44
44
|
```
|
|
@@ -50,7 +50,7 @@ npm install -g @asyncapi/cli
|
|
|
50
50
|
You can install this CLI using [`brew`](https://brew.sh/) package manager.
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
# Install brew
|
|
53
|
+
# Install brew
|
|
54
54
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
55
55
|
# Install AsyncAPI CLI
|
|
56
56
|
brew install asyncapi
|
|
@@ -67,6 +67,48 @@ curl -OL https://github.com/asyncapi/cli/releases/latest/download/asyncapi.pkg
|
|
|
67
67
|
sudo installer -pkg asyncapi.pkg -target /
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
### Linux
|
|
71
|
+
|
|
72
|
+
#### For debian based distros
|
|
73
|
+
|
|
74
|
+
You can install this CLI using `dpkg`, a package manager for debian.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Download latest release. To download specific release, your link should look similar to https://github.com/asyncapi/cli/releases/download/v0.13.0/asyncapi.deb. All releases are listed in https://github.com/asyncapi/cli/releases
|
|
78
|
+
curl -OL https://github.com/asyncapi/cli/releases/latest/download/asyncapi.deb
|
|
79
|
+
# Install AsyncAPI CLI
|
|
80
|
+
sudo dpkg -i asyncapi.deb
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### For other distros
|
|
84
|
+
|
|
85
|
+
You can install this CLI using the archive(`tar.gz`) file.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Download latest release. To download specific release, your link should look similar to https://github.com/asyncapi/cli/releases/download/v0.13.0/asyncapi.tar.gz. All releases are listed in https://github.com/asyncapi/cli/releases
|
|
89
|
+
curl -OL https://github.com/asyncapi/cli/releases/latest/download/asyncapi.tar.gz
|
|
90
|
+
# Untar the archive file
|
|
91
|
+
tar -xzf asyncapi.tar.gz
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The above step will create an `asyncapi` directory in the current path.
|
|
95
|
+
|
|
96
|
+
Create a symlink to run the CLI from anywhere. We will create the symlink in `/usr/local/bin` directory since this directory is already in the `PATH`.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# cd into the unarchived directory
|
|
100
|
+
cd asyncapi
|
|
101
|
+
|
|
102
|
+
# get the absolute path
|
|
103
|
+
pwd
|
|
104
|
+
|
|
105
|
+
# Create a symlink
|
|
106
|
+
ln -s <absolute-path>/bin/asyncapi /usr/local/bin/asyncapi
|
|
107
|
+
|
|
108
|
+
# The `asyncapi` command should be available to be used
|
|
109
|
+
asyncapi
|
|
110
|
+
```
|
|
111
|
+
|
|
70
112
|
## Usage
|
|
71
113
|
|
|
72
114
|
As of now, the `@asyncapi/cli` only supports validation of the specification file. (This is still under development for more features.)
|
|
@@ -74,7 +116,7 @@ As of now, the `@asyncapi/cli` only supports validation of the specification fil
|
|
|
74
116
|
We have well-documented help commands so just run:
|
|
75
117
|
|
|
76
118
|
```
|
|
77
|
-
asyncapi --help
|
|
119
|
+
asyncapi --help
|
|
78
120
|
```
|
|
79
121
|
|
|
80
122
|
It should print something like:
|
|
@@ -108,6 +150,7 @@ Read [CONTRIBUTING](https://github.com/asyncapi/.github/blob/master/CONTRIBUTING
|
|
|
108
150
|
### Set up development environment
|
|
109
151
|
|
|
110
152
|
Follow these steps:
|
|
153
|
+
|
|
111
154
|
- Clone the repo.
|
|
112
155
|
- Run `npm install` to install all the required dependencies
|
|
113
156
|
- Run `npm run test` to make sure everything is properly set up
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.
|
|
1
|
+
{"version":"0.23.0","commands":{"convert":{"id":"convert","description":"convert asyncapi documents older to newer versions","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"output":{"name":"output","type":"option","char":"o","description":"path to the file where the result is saved","multiple":false},"target-version":{"name":"target-version","type":"option","char":"t","description":"asyncapi version to convert to","multiple":false,"default":"2.4.0"}},"args":[{"name":"spec-file","description":"spec path, url, or context-name","required":false}],"_globalFlags":{}},"diff":{"id":"diff","description":"find diff between two asyncapi files","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"format":{"name":"format","type":"option","char":"f","description":"format of the output","multiple":false,"options":["json","yaml","yml"],"default":"yaml"},"type":{"name":"type","type":"option","char":"t","description":"type of the output","multiple":false,"options":["breaking","non-breaking","unclassified","all"],"default":"all"},"overrides":{"name":"overrides","type":"option","char":"o","description":"path to JSON file containing the override properties","multiple":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Enable watch mode","allowNo":false}},"args":[{"name":"old","description":"old spec path, URL or context-name","required":true},{"name":"new","description":"new spec path, URL or context-name","required":true}],"_globalFlags":{}},"new":{"id":"new","description":"creates a new asyncapi file","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"file-name":{"name":"file-name","type":"option","char":"n","description":"name of the file","multiple":false},"example":{"name":"example","type":"option","char":"e","description":"name of the example to use","multiple":false},"studio":{"name":"studio","type":"boolean","char":"s","description":"open in Studio","allowNo":false},"port":{"name":"port","type":"option","char":"p","description":"port in which to start Studio","multiple":false},"no-tty":{"name":"no-tty","type":"boolean","description":"do not use an interactive terminal","allowNo":false}},"args":[],"_globalFlags":{}},"validate":{"id":"validate","description":"validate asyncapi file","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Enable watch mode","allowNo":false}},"args":[{"name":"spec-file","description":"spec path, url, or context-name","required":false}],"_globalFlags":{}},"config":{"id":"config","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"generate:models":{"id":"generate:models","description":"Generates typed models","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"output":{"name":"output","type":"option","char":"o","description":"The output directory where the models should be written to. Omitting this flag will write the models to `stdout`.","required":false,"multiple":false},"packageName":{"name":"packageName","type":"option","description":"Go and Java specific, define the package to use for the generated models. This is required when language is `go` or `java`.","required":false,"multiple":false},"namespace":{"name":"namespace","type":"option","description":"C# specific, define the namespace to use for the generated models. This is required when language is `csharp`.","required":false,"multiple":false}},"args":[{"name":"language","description":"The language you want the typed models generated for.","required":true,"options":["typescript","csharp","golang","java","javascript","dart"]},{"name":"file","description":"Path or URL to the AsyncAPI document, or context-name","required":true}],"_globalFlags":{}},"start":{"id":"start","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"start:studio":{"id":"start:studio","description":"starts a new local instance of Studio","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"file":{"name":"file","type":"option","char":"f","description":"path to the AsyncAPI file to link with Studio","multiple":false},"port":{"name":"port","type":"option","char":"p","description":"port in which to start Studio","multiple":false}},"args":[],"_globalFlags":{}},"config:context:add":{"id":"config:context:add","description":"Add or modify a context in the store","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"context-name","description":"context name","required":true},{"name":"spec-file-path","description":"file path of the spec file","required":true}],"_globalFlags":{}},"config:context:current":{"id":"config:context:current","description":"Shows the current context that is being used","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[],"_globalFlags":{}},"config:context":{"id":"config:context","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"config:context:list":{"id":"config:context:list","description":"List all the stored context in the store","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[],"_globalFlags":{}},"config:context:remove":{"id":"config:context:remove","description":"Delete a context from the store","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"context-name","description":"Name of the context to delete","required":true}],"_globalFlags":{}},"config:context:use":{"id":"config:context:use","description":"Set a context as current","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"context-name","description":"name of the saved context","required":true}],"_globalFlags":{}}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asyncapi/cli",
|
|
3
3
|
"description": "All in one CLI for all AsyncAPI tools",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.23.0",
|
|
5
5
|
"author": "@asyncapi",
|
|
6
6
|
"bin": {
|
|
7
7
|
"asyncapi": "./bin/run"
|
|
@@ -136,10 +136,11 @@
|
|
|
136
136
|
"generate:readme:toc": "markdown-toc -i README.md",
|
|
137
137
|
"lint": "eslint --max-warnings 0 --config .eslintrc .",
|
|
138
138
|
"lint:fix": "eslint --max-warnings 5 --config .eslintrc . --fix",
|
|
139
|
-
"pack:macos": "oclif pack:macos && npm run pack:
|
|
140
|
-
"pack:linux": "oclif pack:deb",
|
|
139
|
+
"pack:macos": "oclif pack:macos && npm run pack:rename",
|
|
140
|
+
"pack:linux": "oclif pack:deb && npm run pack:rename",
|
|
141
|
+
"pack:tarballs": "oclif pack:tarballs -t linux-x64 && npm run pack:rename",
|
|
141
142
|
"pack:windows": "oclif pack:win",
|
|
142
|
-
"pack:
|
|
143
|
+
"pack:rename": "node scripts/releasePackagesRename.js",
|
|
143
144
|
"postpack": "rimraf oclif.manifest.json",
|
|
144
145
|
"prepublishOnly": "npm run build && oclif manifest",
|
|
145
146
|
"pretest": "npm run build",
|