Cheat Sheet
Pro specific
The following commands are relevant to all assistants built with Rasa.Studio specific
If your team is using Rasa Studio, these CLI commands let you manage and sync your assistant between your local environment and your Studio deployment:Rasa Pro Commands
Logging
If you run into character encoding issues on Windows like:
UnicodeEncodeError: 'charmap' codec can't encode character ... or
the terminal is not displaying colored messages properly, prepend winpty to the command you would like to run.
For example winpty rasa init instead of rasa initSetting log levels
Rasa produces log messages at several different levels (eg. warning, info, error and so on). You can control which level of logs you would like to see with--verbose (same as -v) or --debug (same as -vv) as optional command line arguments. See each command below for more explanation on what these arguments mean.
In addition to CLI arguments, several environment variables allow you to control log output in a more granular way. With these environment variables, you can configure log levels for messages created by external libraries such as Matplotlib, Pika, and Kafka. These variables follow standard logging level in Python. Currently, following environment variables are supported:
- LOG_LEVEL_LIBRARIES: This is the general environment variable to configure log level for the main libraries Rasa uses. It covers Tensorflow,
asyncio, APScheduler, SocketIO, Matplotlib, RabbitMQ, Kafka, gRPC, and a2a-sdk. - LOG_LEVEL_MATPLOTLIB: This is the specialized environment variable to configure log level only for Matplotlib.
- LOG_LEVEL_RABBITMQ: This is the specialized environment variable to configure log level only for AMQP libraries, at the moment it handles log levels from
aio_pikaandaiormq. - LOG_LEVEL_KAFKA: This is the specialized environment variable to configure log level only for kafka.
- LOG_LEVEL_PRESIDIO: This is the specialized environment variable to configure log level only for Presidio, at the moment it handles log levels from
presidio_analyzerandpresidio_anonymizer. - LOG_LEVEL_FAKER: This is the specialized environment variable to configure log level only for Faker.
- LOG_LEVEL_MLFLOW: This is the specialized environment variable to configure log level only for MLFlow.
- LOG_LEVEL_PYMONGO: This is the specialized environment variable to configure log level only for PyMongo.
- LOG_LEVEL_LANGFUSE: This is the specialized environment variable to configure log level only for the Langfuse SDK; it defaults to
ERRORso Langfuse warnings are hidden when thelangfusepackage is installed but tracing is not configured. - LOG_LEVEL_MCP: This is the specialized environment variable to configure log level only for the MCP client and its HTTP libraries (
mcp.client,httpcore,httpx); it defaults toERROR. SetMCP_LOGGING_ENABLED=falseto disable MCP logging entirely. - LOG_LEVEL_OPENAI: This is the specialized environment variable to configure log level only for the OpenAI SDK (
openai); it defaults toWARNING.
LOG_LEVEL_LIBRARIES) has less priority than library level specific configuration (LOG_LEVEL_MATPLOTLIB, LOG_LEVEL_RABBITMQ etc); and CLI parameter sets the lowest level log messages which will be handled. This means variables can be used together with a predictable result. As an example:
- messages with
DEBUGlevel and higher by default (due to--debug) - messages with
WARNINGlevel and higher for Matplotlib - messages with
DEBUGlevel and higher for kafka - messages with
ERRORlevel and higher for other libraries not configured
INFO (due to --verbose) and no debug messages will be seen (library level configuration will not have any effect):
coloredlogs handler); this means even if an environment variable sets a library logger to a lower level, the root logger will reject messages from that library. If not specified, the CLI log level is set to INFO.
Log Level LLM Components
Rasa provides enhanced control over the debugging process of LLM-driven components via a fine-grained, customizable logging specified through environment variables. For example, set theLOG_LEVEL_LLM environment variable to enable detailed logging at the desired level for all the LLM components or specify the component you are debugging by setting for example the LOG_LEVEL_LLM_ENTERPRISE_SEARCH environment variable:
LOG_LEVEL_LLM_COMMAND_GENERATOR variable applies to all types of LLM-based command generators.
Custom logging configuration
v3.4The Rasa CLI now includes a new argument
--logging-config-file which accepts a YAML file as value.--logging-config-file CLI option and use it with any of the rasa commands.
Custom logging configuration example
The following example illustrates how to customize the logging configuration using a YAML file. Here we define a custom formatter, a stream handler for the root logger and a file handler for the rasa logger.In Rasa Pro 3.9, running
rasa shell or rasa interactive in debug mode could result in BlockingIOError when using
the default logging configuration. This issue is resolved by using a custom logging configuration file.
If you encounter this issue, you can use the above example to create a custom logging configuration file
and pass it to the --logging-config-file argument.rasa init
This command sets up a complete assistant for you with some example training data:rasa init creates the following files:
models directory will be empty.
This is the best way to get started writing an NLU assistant. You can run rasa train, rasa shell and rasa test without any additional configuration.
Rasa supplies two other templates in addition to the default NLU template
described above. Both of these are great ways to get started building your own
CALM bots:
rasa init --template calmgenerates a CALM assistant with flows and a custom action to manage a simple contact list.rasa init --template tutorialgenerates the codebase used in the CALM Tutorial.
rasa train
The following command trains a Rasa model:models/ by default), only
the parts of your model that have changed will be re-trained. For example, if you edit
your NLU training data and nothing else, only the NLU part will be trained.
If you want to train an NLU or dialogue model individually, you can run
rasa train nlu or rasa train core. If you provide training data only for one one of
these, rasa train will fall back to one of these commands by default.
rasa train will store the trained model in the directory defined by --out, models/ by default.
The name of the model by default is <timestamp>.tar.gz. If you want to name your model differently,
you can specify the name using the --fixed-model-name flag.
By default validation is run before training the model. If you want to skip validation, you can use the --skip-validation flag.
If you want to fail on validation warnings, you can use the --fail-on-validation-warnings flag.
The --validation-max-history is analogous to the --max-history argument of rasa data validate.
Run rasa train --help to see the full list of arguments.
rasa shell
You can start a chat session by running:--model flag.
If you start the shell with an NLU-only model, rasa shell will output the
intents and entities predicted for any message you enter.
If you have trained a combined Rasa model but only want to see what your model
extracts as intents and entities from text, you can use the command rasa shell nlu.
To increase the logging level for debugging, run:
In order to see the typical greetings and/or session start behavior you might see
in an external channel, you will need to explicitly send
/session_start
as the first message. Otherwise, the session start behavior will begin as described in
Session configuration.rasa run; see the following section for more info on those arguments.
Note that the --connector argument will always be set to cmdline when running rasa shell.
This means all credentials in your credentials file will be ignored,
and if you provide your own value for the --connector argument it will also be ignored.
Run rasa shell --help to see the full list of arguments.
rasa run
To start a server running your trained model, run:rasa run command.
If you encrypted your keyfile with a password during creation,
you need to add the --ssl-password as well.
-i command line option.
--connector argument.
rasa run --help to see the full list of arguments.
For more information on important additional parameters, see Model Storage
See the Rasa REST API page for detailed documentation of all the endpoints.
rasa run actions
To start an action server with the Rasa SDK, run:rasa run actions --help to see the full list of arguments.
rasa visualize
To generate a graph of your stories in the browser, run:data/,
you can specify their location with the --stories flag.
Run rasa visualize --help to see the full list of arguments.
rasa test e2e
v3.5You can now use end-to-end testing to test your assistant as a whole, including dialogue management and custom actions.
--model flag.
By adding the
--coverage-report flag you obtain a report describing how well your
end-to-end tests cover the assistant’s flows in terms of share of steps
tested per flow. The report includes a histogram of tested commands and allows
you to specify the output path with the --coverage-output-path flag.This feature is currently released in a beta version. The feature might change in the future.
If you want to enable this beta feature, set the environment variable
RASA_PRO_BETA_FINE_TUNING_RECIPE=true.New in 3.15.0
- You can now specify a custom output path for the end-to-end test results using the
-oor--e2e-resultsflag. - You can also now export failed end-to-end tests using the
-for--e2e-failed-testsflag. This also accepts an optional output path for the failed tests file. This file can then be used to re-run only the failed tests by passing it as an argument to therasa test e2ecommand.
- positional argument for the path to the test cases file or directory containing the test cases:
rasa test e2e <path>If unspecified, the default path istests/e2e_test_cases.yml. - optional argument for the trained model:
-model <path> - optional argument for retrieving the trained model from remote storage:
-remote-storage <remote-storage-location> - optional argument for the
endpoints.ymlfile:-endpoints <path> - optional argument for stopping the test run at first failure:
rasa test e2e --fail-fast - optional argument for exporting the test results to
e2e_results.ymlfile:rasa test e2e -oorrasa test e2e -o <output-path>. When you specify the-oflag without an output path, the passed and failed test results yml files will be saved to thetests/subdirectory in the current working directory. - optional argument for exporting failed tests to
e2e_failed_tests_{timestamp}.ymlfile:rasa test e2e -forrasa test e2e -f <output-path>. When you specify the-fflag without an output path, the failed test file will be saved to thetests/subdirectory in the current working directory. - optional argument for creating a coverage report:
rasa test e2e --coverage-report - optional argument for specifying the output directory for the coverage report:
rasa test e2e --coverage-output-path - you can optionally dump results to
stdoutor to a file (o), plus coverage details with--coverage-report.
rasa test e2e --help to see the full list of arguments.
rasa llm finetune prepare-data
v3.10This command is part of the fine-tuning recipe available starting
with version
3.10.0. As this feature is a beta feature, please set the environment variable
RASA_PRO_BETA_FINETUNING_RECIPE to true to enable it.rasa finetune prepare-data --help to see all available arguments.
Resulting file structure
rasa inspect
v3.7This command is part of Rasa’s new
Conversational AI with Language Models (CALM) approach and available starting
with version
3.7.0.--voice flag. Using --voice on its own raises an error. To test voice with the legacy Inspector, combine it with the --legacy flag:
rasa inspect --help to see the full list of arguments.
rasa inspect —nextgen
v3.16 Opens a preview of the nextgen Rasa Inspector, which will include both the legacy inspector features from Pro, Studio and additional features for better debugging and development. This will replace the old Rasa Inspector in 3.17.rasa data validate
You can check your domain, NLU data, flows or story data for mistakes and inconsistencies. To validate your data, run this command:Searching for the assistant_id key introduced in 3.5The validator will check whether the
assistant_id key is present in the config file and will issue a warning if this
key is missing or if the default value has not been changed.max_history value to one or more policies in your config.yml file, provide the
smallest of those values in the validator command using the --max-history <max_history> flag.
Validate flows
The validator will perform the following checks on flows:- determine whether flow names or descriptions are unique after stripping punctuation
- verify whether logical expressions in conditions or
collectstep rejections are validpypredexpressions - determine whether slots used in flows are defined in the domain
- disallow
listslots from being used in flowscollectsteps: CALM supports only filling slots with values of typeint,stringorboolin flows. - disallow
dialogue_stackinternal slot from being used in flows - ensure that
boolandcategoricalslots are validated against acceptable values in conditions
rasa export
To export events from a tracker store using an event broker, run:rasa export --help to see the full list of arguments.
rasa license
v3.3 Userasa license to display information about licensing in Rasa, especially information about
3rd party dependencies licenses.
Run rasa license --help to see the full list of arguments.
Requesting a Developer License
If you run a licensed Rasa CLI command without settingRASA_LICENSE, the CLI prompts you for an email address in an interactive terminal and submits a Rasa Developer Edition license request on your behalf. Licensed commands include rasa train, rasa run, rasa inspect, rasa license, rasa tools, rasa telemetry, and rasa --version. The CLI exits after submitting the request. Set RASA_LICENSE to the returned key and rerun the command.
Submitting the email opts you into the Rasa Developer Terms and the marketing consent attached to the license request form.
rasa --help, rasa -h, and subcommand help (for example rasa train --help) do not require a license and never trigger the prompt.
To disable the interactive prompt (for example in CI), pass --no-prompt or run the command in a non-interactive shell. The CLI then exits with the license error as before.
See Licensing for details on setting RASA_LICENSE.
Rasa Studio Commands
The CLI commands for Rasa Studio enable you to manage updates between your local project and changes made by your team in Studio.- Connect to a Studio Deployment:
rasa studio config - Login and authenticate:
rasa studio login - Upload or Download a full project:
rasa studio upload/download - Link a specific assistant project:
rasa studio link <assistant-project-name> - Push and pull updates between Studio and your local project:
rasa studio push/pull
rasa studio config
v3.7This command is available from Rasa Pro 3.7.0 and requires Rasa Studio
rasa studio commands.
Configuration is saved to:
$HOME/.config/rasa/global.yml
The command will use default arguments for the configuration of the
authentication server (realm name, client id and authentication url).
If you want to use a different configuration, you can specify the parameters
by running the command with rasa studio config --advanced.
The command will overwrite the existing configuration file with the new
configuration.
Example:
--disable-verify or -x flag:
rasa studio config --help to see the full list of arguments.
rasa studio login
v3.7 This command is used to retrieve the access token from Rasa Studio. All other studio commands use this token to authenticate with Rasa Studio. The token is saved to:$HOME/.config/rasa/studio_token.yaml
Example:
rasa studio login --help to see the full list of arguments.
rasa studio upload
v3.13new in 3.13You can now upload and download a full project using the Rasa CLI as well as link a Studio project to a local project for easier syncing.
Import of NLU-based assistants
For NLU-based assistants, it will upload the intent and entity definitions to Rasa Studio to an existing assistant in Rasa Studio. When arguments for specifying which intents or entities to upload are not given, all intents and entities get uploaded. When uploading an intent, all entities used in annotations of that intent’s utterance examples are uploaded as well. Example:rasa studio upload --help to see the full list of arguments.
Overwriting an existing assistant
new in 3.16You can now delete an existing assistant automatically before uploading by using the
--dangerously-delete-existing flag.--dangerously-delete-existing flag:
Possible errors
Assistant name errors
These include the following:Assistant with name <assistant_name> already exists<assistant_name> is not a valid name
Invalid YAML errors
If something is wrong with the YAML files structure, a specific error will be logged. You will see these errors when, for example, a required field is missing for an action, slot, response, config or flow. Examples:Reference errors
If a flow references a response, slot, action or another flow (with alink step), the following errors will be logged:
Unsupported feature errors
Not all the features available in Rasa Pro are supported by Rasa Studio. Trying to import an assistant with unsupported features will result in an error. To find out which versions of Studio support the version of Rasa Pro you are using, check the compatibility matrix. Examples:Authentication errors
User needs to be logged into Rasa Studio before uploading. Use therasa studio login command.
rasa studio download
v3.13 This command downloads a specified assistant project from Rasa Studio and creates a folder using the assistant name. The following data is supported:- configuration
- endpoints
- custom prompts
- flows (for CALM assistants)
- responses
- slots
- custom action declarations
- intents
- entities
./my_awesome_assistant
Run rasa studio download --help to see the full list of arguments.
rasa studio link
v3.13 Links your local assistant to a project in Rasa Studio. You can specify the assistant name as an argument:download, upload, pull, and push) will refer to this assistant.
rasa studio pull
v3.13 Pulls the latest changes from your Rasa Studio assistant into your local project. You can either pull the entire assistant:config, endpoints.
rasa studio push
v3.13 Pushes the latest changes from your local project to your Rasa Studio assistant. You can either push everything:config, endpoints.
Legacy commands
rasa studio upload
v3.7 Uploads an assistant from local files to Rasa Studio.Import of NLU-based assistants
For NLU-based assistants, it will upload the intent and entity definitions to Rasa Studio to an existing assistant in Rasa Studio. When arguments for specifying which intents or entities to upload are not given, all intents and entities get uploaded. When uploading an intent, all entities used in annotations of that intent’s utterance examples are uploaded as well. Example:rasa studio upload --help to see the full list of arguments.
Import of CALM assistants
To upload a CALM assistant to Rasa Studio, run this command with--calm flag.
Important!
- When uploading a CALM assistant, a new Rasa Studio assistant with specified name will be created. This is different from the NLU-based assistant upload, which will reuse an existing Rasa Studio assistant.
- During CALM upload, we also upload
configandendpointsthat can be edited in the UI.
rasa studio download
v3.7 This command downloads the data from Rasa Studio and saves it to files insidedata folder.
If local files use a single domain file, it is updated accordingly.
If there is a domain folder instead, domain changes are written to <domain_folder>/studio_domain.yml.
The command downloads Studio data that is available in Studio but not in local files.
The following data is supported:
- configuration
- endpoints
- custom prompts
- flows (for CALM assistants)
- responses
- slots
- custom action declarations
- intents
- entities
--overwrite flag can be used to overwrite the existing data in the existing files when a primitive has the same ID
as the one downloaded from Rasa Studio.
Special cases:
- If an intent exists in local files, but Studio has examples missing locally, they will be downloaded.
- If local
configandendpointsfiles exist during the download of a CALM assistant, the user needs to confirm their intent to overwrite them, even when the--overwriteflag is provided.
rasa studio download --help to see the full list of arguments.
rasa studio train
v3.7 This command is analogous torasa train. This command combines data from local files and Rasa Studio to train a model.
In case both Studio and local files have a primitive with the same ID,
the local one is used for training.
Example:
rasa studio train --help to see the full list of arguments.