cli
cli copied to clipboard
CLI to work with your AsyncAPI files. You can validate them and in the future use a generator and even bootstrap a new file. Contributions are welcomed!
CLI to work with your AsyncAPI files. Currently supports validation, but it is under development for more features.
Table of contents
- Installation
- Using NPM and Node
- MacOS
- Using brew
- Using pkg
- Usage
- Contributing
- Set up development environment
- Command Structure and Patterns
- Contributors
Installation
Using NPM and Node
To run @asyncapi/cli, you'll need Node.js >=v10
Run this terminal command to check your Node.js version:
node -v
If you don't have Node.js installed or NPM, simply install both via package manager
Install the CLI globaly on your system run CLI it from anywhere:
npm install -g @asyncapi/cli
MacOS
Using brew
You can install this CLI using brew package manager.
# Install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install AsyncAPI CLI
brew install asyncapi
Using pkg
Each release of CLI produces a MacOS dedicated pkg file that enables you to install this CLI as MacOS application.
# Download latest release. To download specific release, your link should look similar to https://github.com/asyncapi/cli/releases/download/v0.13.0/asyncapi.pkg. All releases are listed in https://github.com/asyncapi/cli/releases
curl -OL https://github.com/asyncapi/cli/releases/latest/download/asyncapi.pkg
# Install AsyncAPI CLI
sudo installer -pkg asyncapi.pkg -target /
Usage
As of now, the @asyncapi/cli only supports validation of the specification file. (This is still under development for more features.)
We have well-documented help commands so just run:
asyncapi --help
It should print something like:
All in one CLI for all AsyncAPI tools
USAGE
$ asyncapi [COMMAND]
COMMANDS
config access configs
diff find diff between two AsyncAPI files
new creates a new AsyncAPI file
start starts a new local instance of Studio
validate validate an AsyncAPI file
generate generate all kinds of stuff
models generate all the typed models for the message payloads defined in the AsyncAPI file
typescript generate the models for TypeScript
csharp generate the models for C#
golang generate the models for Go
java generate the models for Java
javascript generate the models for JavaScript
dart generate the models for Dart
Contributing
Read CONTRIBUTING guide.
Set up development environment
Follow these steps:
- Clone the repo.
- Run
npm installto install all the required dependencies - Run
npm run testto make sure everything is properly set up - Run
npm run buildand thenbin/runto try new CLI locally
UX developed for the CLI should be compliant with Command Line Interface Guideline
Command Structure and Patterns
We are following verb + noun and namespace + noun + [verb] pattern for making our commands and arguments. For example asyncapi validate <spec-file-path> and asyncapi config context add <context-name> <spec-file-path>.
Contributors
Thanks goes to these wonderful people (emoji key):
Jorge Aguiar MartΓn π» π€ β οΈ π |
Lukasz Gornicki π€ π» π π§ |
souvik π» π€ β οΈ π π§ π |
David Boyne π» π€ π§ |
Fran MΓ©ndez π» π€ π |
Maciej UrbaΕczyk π π§ π€ |
Aayush Kumar Sahu π» β οΈ |
Mihir Kulkarni π» |
Abir β οΈ π» |
Peter Ramos π» |
Samriddhi β οΈ |
Pranay Kharabe π» |
This project follows the all-contributors specification. Contributions of any kind welcome!
