Skip to content
/ cli Public

cli for running commands against microservices and printing the responses

License

Notifications You must be signed in to change notification settings

microfleet/cli

Repository files navigation

@microfleet/cli

CLI for running commands against AMQP transport in @microfleet/core services.

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

$ 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

About

cli for running commands against microservices and printing the responses

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •