# Command Line Interface

The command line interface (CLI) gives you easy-to-remember commands for common tasks.

| Command | Effect |
| --- | --- |
| `rasa init` | Creates a new project with example training data, actions, and config files. |
| `rasa train` | Trains a model using your NLU data and stories, saves trained model in `./models`. |
| `rasa interactive` | Starts an interactive learning session to create new training data by chatting. |
| `rasa shell` | Loads your trained model and lets you talk to your assistant on the command line. |
| `rasa run` | Starts a Rasa server with your trained model. See the [Configuring the HTTP API](https://legacy-docs-v1.rasa.com/1.10.14/user-guide/configuring-http-api/#configuring-http-api) docs for details. |
| `rasa run actions` | Starts an action server using the Rasa SDK. |
| `rasa visualize` | Visualizes stories. |
| `rasa test` | Tests a trained Rasa model using your test NLU data and stories. |
| `rasa data split nlu` | Performs a split of your NLU data according to the specified percentages. |
| `rasa data convert nlu` | Converts NLU training data between different formats. |
| `rasa export` | Export conversations from a tracker store to an event broker. |
| `rasa x` | Launch Rasa X locally. |
| `rasa -h` | Shows all available commands. |

## [Create a new project](https://legacy-docs-v1.rasa.com/1.10.14/user-guide/command-line-interface/#create-a-new-project) 
A single command sets up a complete project for you with some example training data.

```bash
rasa init
```

This creates the following files:

```
.
├── __init__.py
├── actions.py
├── config.yml
├── credentials.yml
├── data
│   ├── nlu.md
│   └── stories.md
├── domain.yml
├── endpoints.yml
└── models
    └── <timestamp>.tar.gz
```

The `rasa init` command will ask you if you want to train an initial model using this data.
If you answer no, the `models` directory will be empty.

## [Train a Model](https://legacy-docs-v1.rasa.com/1.10.14/user-guide/command-line-interface/#train-a-model)
The main command is:

```bash
rasa train
```
This command trains a Rasa model that combines a Rasa NLU and a Rasa Core model.
If you only want to train an NLU or a Core model, you can run `rasa train nlu` or `rasa train core`.

However, Rasa will automatically skip training Core or NLU if the training data and config haven’t changed.

`rasa train` will store the trained model in the directory defined by `--out`. The name of the model
is per default `<timestamp>.tar.gz`. If you want to name your model differently, you can specify the name
using `--fixed-model-name`.

The following arguments can be used to configure the training process:

```
usage: rasa train [-h] [-v] [-vv] [--quiet] [--data DATA [DATA ...]]
                  [-c CONFIG] [-d DOMAIN] [--out OUT]
                  [--augmentation AUGMENTATION] [--debug-plots]
                  [--fixed-model-name FIXED_MODEL_NAME] [--persist-nlu-data]
                  [--force]
                  {core,nlu} ...

positional arguments:
  {core,nlu}
    core                Trains a Rasa Core model using your stories.
    nlu                 Trains a Rasa NLU model using your NLU data.

optional arguments:
  -h, --help            show this help message and exit
  --data DATA [DATA ...]
                        Paths to the Core and NLU data files. (default:
                        ['data'])
  -c CONFIG, --config CONFIG
                        The policy and NLU pipeline configuration of your bot.
                        (default: config.yml)
  -d DOMAIN, --domain DOMAIN
                        Domain specification (yml file). (default: domain.yml)
  --out OUT             Directory where your models should be stored.
                        (default: models)
  --augmentation AUGMENTATION
                        How much data augmentation to use during training.
                        (default: 50)
  --debug-plots         If enabled, will create plots showing checkpoints and
                        their connections between story blocks in a file
                        called `story_blocks_connections.html`. (default:
                        False)
  --fixed-model-name FIXED_MODEL_NAME
                        If set, the name of the model file/directory will be
                        set to the given name. (default: None)
  --persist-nlu-data    Persist the nlu training data in the saved model.
                        (default: False)
  --force               Force a model training even if the data has not
                        changed. (default: False)
```
Note: 
Make sure training data for Core and NLU are present when training a model using `rasa train`.
If training data for only one model type is present, the command automatically falls back to
`rasa train nlu` or `rasa train core` depending on the provided training files.

## [Interactive Learning](https://legacy-docs-v1.rasa.com/1.10.14/user-guide/command-line-interface/#interactive-learning)
To start an interactive learning session with your assistant, run

```bash
rasa interactive
```
...

The full list of options for `rasa shell` is

```
usage: rasa shell [-h] [-v] [-vv] [--quiet]
                  [--conversation-id CONVERSATION_ID] [-m MODEL]
                  [--log-file LOG_FILE] [--endpoints ENDPOINTS] [-p PORT]
                  [-t AUTH_TOKEN] [--cors [CORS [CORS ...]]] [--enable-api]
                  [--response-timeout RESPONSE_TIMEOUT]
                  [--remote-storage REMOTE_STORAGE]
                  [--ssl-certificate SSL_CERTIFICATE]
                  [--ssl-keyfile SSL_KEYFILE] [--ssl-ca-file SSL_CA_FILE]
                  [--ssl-password SSL_PASSWORD] [--credentials CREDENTIALS]
                  [--connector CONNECTOR] [--jwt-secret JWT_SECRET]
                  [--jwt-method JWT_METHOD]
                  {nlu} ... [model-as-positional-argument]

positional arguments:
  {nlu}
    nlu                 Interprets messages on the command line using your NLU
                        model.
  model-as-positional-argument
                        Path to a trained Rasa model. If a directory is
                        specified, it will use the latest model in this
                        directory. (default: None)

...
