2.12.0 • Published 1 year ago

@cs-chatbots/webchat-cli v2.12.0

Weekly downloads
39
License
UNLICENSED
Repository
-
Last release
1 year ago

webchat-cli

CLI tool for webchat. Can be used for the management of valve, application and channels.

Install webchat CLI

$ sudo npm i -g webchat-cli

General Commands

Init

Sets controlled webchat api url

$ webchat init

Login

A login is needed for the valve related write operations and all channel/application operations. The command asks for a username and a password and after a successful authorization stores an access token received from the API locally (OAuth2). The default validity of the token is one hour. There is a different user for valve (my_username) and for channels/applications (crud).

$ webchat login

History

The CLI stores the history of write operations. This history may be displayed using:

$ webchat history

The commands are stored in the history in a normlized form (e. g. even if we use an interactive version of the command the command stored in the history is the non-interactive one with the same effect).

Valve operations

Get current valve config

$ webchat valve-ls

Set Valve Config

Set Business Hours Probability

$ webchat valve-set businessHours 0.2

Override Current Value

$ webchat valve-set valve.overrideCurrent " -1"

Delete Valve Config

Delete Business Hours probability

$ webchat valve-delete valve.businessHours

Channel Operations

Here are just some examples, see webchat help for full reference:

Create Channel

$ webchat channel-add CHANNEL_NAME

Adds a channel. The CLI will ask for the primary application id, whitelisted origins and applications linked to the channel.

$ webchat channel-add -a !ge_bot_error CHANNEL

Adds the channel CHANNEL and links all applications but ge_bot_error to this channel.

Modify Channel

$ webchat channel-mod -w +http://localhost:3000 CHANNEL

Adds the whitelisted origin http://localhost:3000 to the channel CHANNEL.

Attach To Channel Own Errorbot

$ webchat channel-mod -r ge_bot_error-onb CHANNEL

Adds new errorbot application to the channel CHANNEL.

Delete Channel

$ webchat channel-rm CHANNEL

Application Operations

Create Application

$ webchat app-add -w http://localhost:8030/APP -c CHANNEL_1,CHANNEL_2 APP

Creates the application APP with the webhook http://localhost:8030/APP and links it to the channels CHANNEL_1 and CHANNEL_2.

Modify Application

Here are just some examples, see webchat help for full reference:

$ webchat app-mod -c _CHANNEL_1,CHANNEL_2 APP

Removes the application APP from the channels CHANNEL_1 and CHANNEL_2.

Delete Application

$ webchat app-rm APP

Deletes the application APP.

Setting up for development (locally)

$ git clone
$ cd webchat-cli
$ npm install
$ node ./bin/webchat.js
2.12.0

1 year ago

2.11.0

2 years ago

2.11.0-beta.0

2 years ago

2.10.1

2 years ago

2.10.1-beta.1

2 years ago

2.10.0

2 years ago

2.9.4-beta.1

2 years ago

2.9.3

2 years ago

2.8.0-beta.0

2 years ago

2.9.2

2 years ago

2.9.1

2 years ago

2.7.1-beta.1

2 years ago

2.7.1-beta.0

2 years ago

2.7.0

2 years ago

2.6.1

2 years ago

2.6.0

2 years ago

2.9.0

2 years ago

2.8.0

2 years ago

2.7.1

2 years ago

2.6.1-beta.1

2 years ago

2.6.1-beta.0

2 years ago

2.5.0

3 years ago

2.4.2

3 years ago

2.4.1

3 years ago

2.4.0

3 years ago

2.4.0-beta.0

3 years ago

2.3.0

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago