Skip to main content

CLI

The CLI, command line interface, is a helpful tool that allows you to perform some management functions and additional utilities related to your assistant application. The full source code is available on github.com/xapp-ai/xapp-cli.

Installation

npm install -g @xapp/cli

Confirm your installation with

xapp -V
warning

Currently only Windows WSL2 and macOS are supported. The behavior on Windows Shell is unknown.

Authenticating

Before running any command, you will need to first authenticate

xapp login

And while not required, you can also logout

xapp logout

Configuration

You can configure the CLI to point to different OC Studio environments.

Recommended approach is to modify the configuration JSON file found at ~/.xapp/cli_config and then adding different profiles.

For example, if you want to add a profile called stentor, fill in the parameters under `

{
"profiles": {
"default": {},
"stentor": {
"basePath": "",
"authPath": "",
"clientId": "",
"path": "auth",
"tokenPath": "oauth/token"
}
},
"created": "2021-02-23T22:30:17.345Z",
"modified": "2021-11-09T17:17:32.694Z",
"currentProfile": "stentor"
}

Then, to use this profile run:

xapp set -p stentor

To reset back to the default, run:

xapp set -p default

Information

You can query general descriptive information about an application by application ID.

xapp info {{appId}}

Generating Types

When developing, it can be helpful to have access to the intents requests and their possible slot values. You can use the CLI to generate a TypeScript file with all the requests that are specific to your interaction model.

xapp types -h "/*! Copyright (c) 2022, XAPP AI */" -f requests.ts -m 50 ./src/models  {{appId}}

The above command will generate a file named requests.ts at the ./src/models directory with a header at the top to prevent any lint errors. The -m 50 states to generate a type based on an entities values up to a max of 50 values, otherwise it will set the type as string. Optional fields are -h, -f, and -m.

Importing

Importing from Dialogflow

You can import an existing project from Dialogflow ES.

Prerequisites

  • Studio Organization
  • GCP Service Account with Dialogflow Admin permissions credentials JSON file
xapp import -p d -c {path-to-JSON-credentials-file} -o {orgId-for-import}
warning

Some Dialogflow features are not supported and will not be imported.