This repository contains CLI tool that talks to CNS Dapr, written in Node.js and using the Dapr SDK. The CLI is used in conjunction with CNS Dapr and it is assumed this is already installed and running (See the CNS Dapr repository for details).
The CLI includes various commands that map to the services provided by CNS Dapr.
To install or update the application, you should fetch the latest version from this Git repository. To do that, you may either download and unpack the repo zip file, or clone the repo using:
git clone https://github.com/cnscp/cns-cli.git
Either method should get you a copy of the latest version. It is recommended (but not compulsory) to place the repo in the ~/cns-cli
project directory. Go to the project directory and install Node.js dependancies with:
npm install
Install as a global command with:
npm install -g .
Your application should now be ready to rock.
Once installed, run the application with:
cns
To shut down the application, hit ctrl-c
twice or enter exit
.
The application uses the following environment variables to configure itself:
Variable | Description | Default |
---|---|---|
CNS_BROKER | CNS Broker service | 'padi' |
CNS_CONTEXT | CNS Broker context | Must be set |
CNS_TOKEN | CNS Broker token | Must be set |
CNS_DAPR | CNS Dapr application | 'cns-dapr' |
CNS_DAPR_HOST | CNS Dapr host | 'localhost' |
CNS_DAPR_PORT | CNS Dapr port | '3500' |
CNS_PUBSUB | CNS Dapr PUBSUB component | 'cns-pubsub' |
CNS_SERVER_HOST | Dapr server host | 'localhost' |
CNS_SERVER_PORT | Dapr server port | '3100' |
Alternatively, variables can be stored in a .env
file in the project directory.
Command | Description |
---|---|
init | Write .env config file in current directory |
config | Show the current config properties |
config CNS_CONTEXT id | Set the current CNS context id |
map | Show information about the CNS context |
See the help
command for further information.
See LICENSE.md.
See COPYRIGHT.md.