Skip to main content
The NeMo Guardrails CLI provides a set of commands for interactive testing, server deployment, and configuration management.

Installation

The CLI is automatically installed with NeMo Guardrails:
Verify installation:

Available Commands

View all available commands:
Output:

chat

Start an interactive chat session with your guardrails configuration.

Basic Usage

Options

string
default:"config"
required
Path to a directory containing configuration files or a single configuration file.
boolean
default:"false"
Enable detailed logging information including LLM calls.
boolean
default:"false"
Enable verbose output but exclude prompts and responses for LLM calls.
boolean
default:"false"
Simplify the verbose output further.
string
Enable debug mode with rich flow execution information. Available levels: WARNING, INFO, DEBUG.
boolean
default:"false"
Enable streaming mode for token-by-token responses.
string
If specified, the chat CLI will interact with a server instead of loading the config locally.
string
The config_id to use when interacting with a server (required with --server-url).

Interactive Commands

When in a chat session, you can use special commands: Colang 2.x Commands:
General Commands:
  • Press Ctrl+C twice to quit
  • Press Enter with empty input to check for pending async actions (Colang 2.x)

Examples

1

Start a basic chat session

Output:
2

Enable verbose mode to see internal processing

Shows:
  • Canonical form detection
  • Flow execution
  • LLM prompts and completions
  • Rail activations
3

Test streaming responses

Responses appear token-by-token as they’re generated.
4

Connect to a remote server

server

Start a NeMo Guardrails REST API server.

Basic Usage

Options

string
default:"./config"
Path to a directory containing multiple configuration sub-folders.
integer
default:"8000"
The port that the server should listen on.
string
The default configuration to use when no config is specified in requests.
boolean
default:"false"
Enable verbose logging including prompts.
boolean
default:"false"
Disable the web-based Chat UI.
boolean
default:"false"
Enable automatic reloading when configuration files change.
string
default:""
A prefix to add to all server paths (must start with ’/’).

Examples

Start server on custom port
Enable auto-reload for development
API-only mode (no UI)
See the Server Guide for detailed information.

eval

Run evaluation tasks on your guardrails configuration.

Basic Usage

The eval command is part of the evaluation framework. See the evaluation documentation for detailed usage.

Common Evaluation Types

actions-server

Start a dedicated actions server for remote action execution.

Basic Usage

Options

integer
default:"8001"
The port that the actions server should listen on.

Use Case

The actions server allows you to:
  • Run custom Python actions remotely
  • Separate action execution from the main guardrails server
  • Scale action execution independently
Configuration:
config.yml

convert

Convert Colang files from older versions to the latest version.

Basic Usage

Options

string
required
The path to the file or directory to migrate.
string
default:"1.0"
The version to migrate from. Available: 1.0, 2.0-alpha.
boolean
default:"false"
Enable verbose logging.
boolean
default:"false"
Validate the output using the Colang parser.
boolean
default:"true"
Use the active decorator in the migrated code.
boolean
default:"true"
Add a main flow to the migrated configuration.

find-providers

List and interactively select LLM providers.

Basic Usage

Options

boolean
default:"false"
Just list all available providers without interactive selection.

Interactive Mode

When run without --list, the command provides an interactive interface:
  1. Select provider type: Type to filter between “text completion” and “chat completion”
  2. Select provider: Type to filter through available providers
  3. Navigate: Use arrow keys to navigate, Tab to autocomplete, Enter to select

Common Workflows

Development Workflow

1

Test configuration locally

2

Start server with auto-reload

3

Iterate on configuration files

Edit .co files and config.yml - changes reload automatically
4

Test with streaming

Testing Workflow

1

Run evaluation suite

2

Test with verbose logging

3

Verify against remote server

Deployment Workflow

1

Validate configuration

2

Start production server

3

Monitor with verbose logs

Environment Variables

The CLI respects standard environment variables:

Troubleshooting

Command Not Found

Ensure NeMo Guardrails is installed:

Configuration Not Loading

Verify the path exists and contains valid files:

Streaming Not Working

Enable streaming in configuration:
config.yml

Port Already in Use

Change the port:

Next Steps

Python API

Use guardrails programmatically

Server Guide

Deploy guardrails as a REST API

Configuration

Configure your guardrails

Evaluation

Test and evaluate your guardrails