rasacli
Rasa API CLI
Last updated a month ago by rgstephens .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rasacli 
SYNC missed versions from official npm registry.

rasacli

Rasa API CLI

oclif Version CircleCI Downloads/week License

This command line tool has initially been developed to import content from existing Rasa bots to Rasa X and to clean-up Rasa X so that you can more easily remove all of the content and upload new content on the same instance.

It has been developed in TypeScript with oclif.

Rasa X UI & API

As of the 0.20.0 release of Rasa X, there are limitations on bulk import and delete of content. These limitations prompted the development of rasacli. Here's a comparison of the capabilities of the Rasa X UI, API and rasacli:

NLU Training Data

In past releases of Rasa, the NLU training data could be formatted as json or markdown. The Rasa team has encouraged developers to move to markdown and this is what I have used.

Please note that the tables below refer to bulk operations unless otherwise noted. The UI supports CRUD operations on individual items.

Capability UI API rasacli Notes
Get (md) See issue #4076
Get (json) x gettraining
Get entities (json) x getentities
Get intents (json) x
Add (md) x See issues #4076 and #3580
Add (json) x x
Update (md) updtraining
Update (json) x updtraining -f json
Update by id (md) x
Update by id (json) x x
Delete deltraining
Delete by id x x

Core Stories

Capability UI API rasacli Notes
Get (md) x x getstoriesmd
Get (json) x getstories
Add (md) x addstories
Update (md) x updstories There's a known API bug #4168
Update by id (json) x
Delete delstories
Delete by id x

Template Responses

Capability UI API rasacli Notes
Get x x
Add (json) x x
Update (json) x updtemplates
Delete x deltemplates

Domain

Capability UI API rasacli Notes
Get x x getdomain
Add x There's no POST api call for the domain
Update x upddomain
Delete x deldomain See issue #4080

Examples

To remove all content:

rasacli delall

Environment Variables

The rasacli will use the following environment variables in lieu of their associated command line options:

Env Option Description
RASA_HOST -n Rasa X hostname
RASA_PORT -p Rasa X server port
RASA_PROTO --protocol Server protocol
RASA_USER --username Username
RASA_PASS --password Password
RASA_TOKEN --token Token

Release Notes

0.1.1 - Jul 23, 2019

Initial set of commands: addstories, delstories, deltraining, getdomain, getstories, getstoriesmd, gettraining, upddomain

0.1.2 - Jul 24, 2019

upddomain command added -t option to specify update of templates. See API domain PUT for details on store_templates option along with Rasa X API Github issue #4080.

0.1.3 - Aug 4, 2019

Added deldomain command which is the same as an upddomain but with an empty dataset (you don't have to supply an empty markdown file). Also fixes an addstories file name processing issue.

0.2.0 - Aug 6, 2019

  • Added updtemplates to update response templates. This replaces upddomain -t
  • Added getentities command
  • Added deltemplates to replace deldomain -t but discovered a bug in this api, see #4185
  • Added delall command which calls all of the delete commands supported by rasacli

0.3.0 - Aug 8, 2019

  • Added updtraining to replace NLU training data. Accepts a list of markdown files.

Usage

$ npm install -g rasacli
$ rasacli COMMAND
running command...
$ rasacli (-v|--version|version)
rasacli/0.3.0 darwin-x64 node-v12.4.0
$ rasacli --help [COMMAND]
USAGE
  $ rasacli COMMAND
...

Commands

rasacli addstories FILE

Add stories

USAGE
  $ rasacli addstories FILE

ARGUMENTS
  FILE  Markdown story files (accepts multiple files)

OPTIONS
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -v, --verbose            verbose
  --password=password      password
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/addstories.ts

rasacli delall [PROJECT]

Update domain

USAGE
  $ rasacli delall [PROJECT]

ARGUMENTS
  PROJECT  [default: default] Project name

OPTIONS
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -v, --verbose            verbose
  --password=password      password
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/delall.ts

rasacli deldomain

Delete domain

USAGE
  $ rasacli deldomain

OPTIONS
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -v, --verbose            verbose
  --password=password      password
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/deldomain.ts

rasacli delstories

Delete all stories

USAGE
  $ rasacli delstories

OPTIONS
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -v, --verbose            verbose
  --password=password      password
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/delstories.ts

rasacli deltemplates

Delete templates

USAGE
  $ rasacli deltemplates

OPTIONS
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -v, --verbose            verbose
  --password=password      password
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/deltemplates.ts

rasacli deltraining

Delete all training data

USAGE
  $ rasacli deltraining

OPTIONS
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -v, --verbose            verbose
  --password=password      password
  --project=project        [default: default] Project name
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/deltraining.ts

rasacli getdomain

Get training data

USAGE
  $ rasacli getdomain

OPTIONS
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -v, --verbose            verbose
  --password=password      password
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/getdomain.ts

rasacli getentities [PROJECT]

Get entities

USAGE
  $ rasacli getentities [PROJECT]

ARGUMENTS
  PROJECT  [default: default] Project name

OPTIONS
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -v, --verbose            verbose
  --password=password      password
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/getentities.ts

rasacli getstories

Get stories

USAGE
  $ rasacli getstories

OPTIONS
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -v, --verbose            verbose
  --password=password      password
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/getstories.ts

rasacli getstoriesmd

Get stories as markdown

USAGE
  $ rasacli getstoriesmd

OPTIONS
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -v, --verbose            verbose
  --password=password      password
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/getstoriesmd.ts

rasacli gettraining [PROJECT]

Get training data

USAGE
  $ rasacli gettraining [PROJECT]

ARGUMENTS
  PROJECT  [default: default] Project name

OPTIONS
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -v, --verbose            verbose
  --password=password      password
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/gettraining.ts

rasacli help [COMMAND]

display help for rasacli

USAGE
  $ rasacli help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

rasacli upddomain FILE

Update domain

USAGE
  $ rasacli upddomain FILE

ARGUMENTS
  FILE  Domain yaml file

OPTIONS
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -v, --verbose            verbose
  --password=password      password
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/upddomain.ts

rasacli updstories FILE

Update stories

USAGE
  $ rasacli updstories FILE

ARGUMENTS
  FILE  Markdown story files (accepts multiple files)

OPTIONS
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -v, --verbose            verbose
  --password=password      password
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/updstories.ts

rasacli updtemplates FILE

Update templates

USAGE
  $ rasacli updtemplates FILE

ARGUMENTS
  FILE  Domain yaml file

OPTIONS
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -v, --verbose            verbose
  --password=password      password
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/updtemplates.ts

rasacli updtraining FILE

Update training

USAGE
  $ rasacli updtraining FILE

ARGUMENTS
  FILE  NLU training files (accepts multiple files)

OPTIONS
  -f, --format=format      [default: md] format (json, md)
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -v, --verbose            verbose
  --password=password      password
  --project=project        [default: default] Project name
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/updtraining.ts

Current Tags

  • 0.3.0                                ...           latest (a month ago)

6 Versions

  • 0.3.0                                ...           a month ago
  • 0.2.0                                ...           2 months ago
  • 0.1.3                                ...           2 months ago
  • 0.1.2                                ...           2 months ago
  • 0.1.1                                ...           2 months ago
  • 0.1.0                                ...           2 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 76
Dependencies (5)
Dev Dependencies (13)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |