npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rasacli

v0.4.7

Published

Rasa API CLI

Downloads

28

Readme

rasacli

Rasa API CLI

Version Downloads/week oclif 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.

Table of Contents

Examples

Importing existing content:

export RASA_HOST=mybot.domain.com
export RASA_PASS=mypass
export RASA_PORT=8080
rasacli updtraining data/training/*md
rasacli addstories data/stories/*md
rasacli upddomain data/domain.yml
rasacli updtemplates data/domain.yml
rasacli updconfig data/config.yml

To remove all content:

rasacli delall

Train, list and activate model:

MODEL=`rasacli modeltrain`
rasacli modelactivate --model $MODEL
rasacli modellist

Rasa, Rasa X & rasacli version information:

rasacli version
rasacli vers

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.4.5 - Oct 7, 2019

  • Fixed modeltrain exit code not set
  • Added getconfig and updconfig for config.yml
  • Added modellist
  • Added modeldelete
  • Added modeladdtag, modeldeletetag, modelgettag - Rasa X enterprise only
  • Added --project option to modeltrain, default value is default

0.4.0 - Oct 4, 2019

  • Added vers to display Rasa & Rasa X version info
  • Added -v verbose option
  • Added modeltrain to train the model, returns the name of the new model
  • Added modelactivate to activate a mode, pass the name of the model with -m

0.3.0 - Aug 8, 2019

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

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.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.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.1 - Jul 23, 2019

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

Developer Notes

There's a summary of the Rasa X REST endpoints here.

To add a new command to this project (make sure you save the README.md before running):

npx oclif command NAME

To test a commmand:

./bin/run getstories -v

Force update of README.md (make sure you save the README.md before running):

yarn prepack

Publish an updated version of rasacli:

npm version (major|minor|patch)
npm publish

Publish a beta update:

npm version <new version>-beta.0
npm publish --tag beta

Install beta release:

npm install rasacli@beta.

Usage

$ npm install -g rasacli
$ rasacli COMMAND
running command...
$ rasacli (-v|--version|version)
rasacli/0.4.6 darwin-x64 node-v12.9.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

Update domain

USAGE
  $ rasacli delall

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/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 getconfig

Get config

USAGE
  $ rasacli getconfig

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/getconfig.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

Get entities

USAGE
  $ rasacli getentities

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/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

Get training data

USAGE
  $ rasacli gettraining

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/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 modelactivate

Activate a model

USAGE
  $ rasacli modelactivate

OPTIONS
  -h, --help               show CLI help
  -m, --model=model        (required) model
  -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/modelactivate.ts

rasacli modeladdtag

Add tag to model, enterprise vesion only

USAGE
  $ rasacli modeladdtag

OPTIONS
  -h, --help               show CLI help
  -m, --model=model        (required) model
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -t, --tag=tag            (required) tag
  -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/modeladdtag.ts

rasacli modeldelete

Delete a model

USAGE
  $ rasacli modeldelete

OPTIONS
  -h, --help               show CLI help
  -m, --model=model        (required) model
  -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/modeldelete.ts

rasacli modeldeletetag

Delete tag from model, enterprise vesion only

USAGE
  $ rasacli modeldeletetag

OPTIONS
  -h, --help               show CLI help
  -m, --model=model        (required) model
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -t, --tag=tag            (required) tag
  -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/modeldeletetag.ts

rasacli modelgettag

Get model with tag, downloads zipped model

USAGE
  $ rasacli modelgettag

OPTIONS
  -h, --help               show CLI help
  -n, --hostname=hostname  [default: localhost] hostname
  -p, --port=port          [default: 80] port
  -t, --tag=tag            (required) tag
  -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/modelgettag.ts

rasacli modellist

Activate a model

USAGE
  $ rasacli modellist

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/modellist.ts

rasacli modeltrain

Train a new model

USAGE
  $ rasacli modeltrain

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/modeltrain.ts

rasacli updconfig FILE

Update config

USAGE
  $ rasacli updconfig 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
  --project=project        [default: default] Project name
  --protocol=protocol      [default: http] protocol
  --token=token            token
  --username=username      [default: me] username

See code: src/commands/updconfig.ts

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

rasacli vers

Show version and status information

USAGE
  $ rasacli vers

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/vers.ts