https://github.com/microfleet/cli
cli for running commands against microservices and printing the responses
https://github.com/microfleet/cli
Last synced: about 1 year ago
JSON representation
cli for running commands against microservices and printing the responses
- Host: GitHub
- URL: https://github.com/microfleet/cli
- Owner: microfleet
- License: mit
- Created: 2016-02-03T11:06:48.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2022-03-28T23:23:28.000Z (almost 4 years ago)
- Last Synced: 2024-10-15T02:32:44.041Z (over 1 year ago)
- Language: JavaScript
- Size: 231 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @microfleet/cli
CLI for running commands against AMQP transport in @microfleet/core services.
```sh
Usage: bin/ms-cli.js --q.offset=0 --q.limit=10 -r payments.transactions.common
Options:
--port, -p rabbitmq port [default: 5672]
--host, -h rabbitmq host [default: "localhost"]
--login, -l rabbitmq user [default: "guest"]
--password, -P rabbitmq password [default: "guest"]
--route, -r rabbitmq routing key [required]
--query, -q query object [default: {}]
--timeout, -t request timeout [default: 15000]
--config Path to JSON config file
--help Show help [boolean]
```
## Usage example
Assuming you are running node 8.x.x, where `npx` is bundled you can do the following
to run commands against AMQP-enabled endpoints
```sh
$ docker exec -it <@microfleet/container-name> sh
$ npx @microfleet/cli -r pdf.render -q '{"meta":false,"context":{},"template":"sample"}'
```
Response will be printed to stdout/stderr based on success/failure of the request
In the real-world you'd likely want to run some less complicated requests or prepare them
elsewhere and just use this cli to issue requests so that they end up correctly serialized
and response is then correctly deserialized and printed