# Command Line Interface

## Command Line Interface Overview

The command line interface (CLI) provides 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 [Configuring the HTTP API](https://legacy-docs-v1.rasa.com/1.7.4/user-guide/configuring-http-api/#configuring-http-api) 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 specified percentages. |
| `rasa data convert nlu` | Converts NLU training data between different formats. |
| `rasa x` | Launch Rasa X locally. |
| `rasa -h` | Shows all available commands. |

## Creating 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
```

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

## Training a Model

The main command is:

```bash
rasa train
```

This command trains a Rasa model combining a Rasa NLU and a Rasa Core model. If you want to train an NLU or a Core model alone, use `rasa train nlu` or `rasa train core`. Rasa will automatically skip training Core or NLU if the training data and config haven’t changed.

After training, your model will be stored in the directory defined by `--out`. The name of the model is by default `<timestamp>.tar.gz`. You can specify a name using `--fixed-model-name`.

## Interactive Learning

To start an interactive learning session with your assistant, run:

```bash
rasa interactive
```

If a trained model is provided using the `--model` argument, the interactive learning process is started with the provided model. If no model is specified, `rasa interactive` will train a new Rasa model with the data located in `data/`.

## Starting a Server

To start a server running your Rasa model, run:

```bash
rasa run
```

### Action Server

To run your action server:

```bash
rasa run actions
```

## Visualizing Your Stories

To open a browser tab with a graph showing your stories:

```bash
rasa visualize
```

## Evaluating a Model on Test Data

To evaluate your model on test data, run:

```bash
rasa test
```

## Create a Train-Test Split

To create a split of your NLU data:

```bash
rasa data split nlu
```

## Convert Data Between Markdown and JSON

To convert NLU data from various formats to JSON or Markdown:

```bash
rasa data convert nlu
```

## Starting Rasa X

Rasa X can be started locally by executing:

```bash
rasa x
```

By default, Rasa X runs on port 5002. You can change it using the `--rasa-x-port` argument.

👋 I can help you get started with Rasa and answer your technical questions.
