Skip to main content

Command

Start an interactive chat session in the terminal with guardrails applied.

Options

path
default:"config"
Path to a directory containing configuration files to use. Can also point to a single configuration file.
boolean
default:"false"
If the chat should be verbose and output detailed logging information including internal events and flow execution.
boolean
default:"false"
If the chat should be verbose but exclude the prompts and responses for the LLM calls. Automatically enables --verbose.
boolean
default:"false"
Simplify the verbose output further.
array
Enable debug mode which prints rich information about the flows execution. Available levels: WARNING, INFO, DEBUG. Automatically enables --verbose.
boolean
default:"false"
If the chat should use the streaming mode, if possible. Requires output rails to have streaming enabled.
string
If specified, the chat CLI will interact with a server rather than load the config locally. Must also specify --config-id.
string
The config_id to be used when interacting with the server (required when using --server-url).

Examples

Basic Usage

Start a chat session with default config:
This looks for a config directory in the current folder.

Specify Config Directory

Start chat with a specific config:

Verbose Mode

Enable detailed logging:
Output will include:
  • Internal events
  • Flow execution details
  • LLM prompts and completions
  • Context updates

Verbose Without LLM Details

Show verbose output but hide LLM prompts:

Debug Mode

Enable rich debug output:
Available levels:
  • WARNING: Show only warnings
  • INFO: Show informational messages (recommended)
  • DEBUG: Show detailed debug information

Streaming Mode

Enable streaming for real-time responses:
Requires streaming to be enabled in config.yml:

Chat with Remote Server

Connect to a running guardrails server:

Interactive Commands

While in a chat session, you can use special commands:

Colang 1.0

  • Type your message and press Enter to chat
  • Press Ctrl+C twice to exit

Colang 2.x

  • Type your message and press Enter to chat
  • Type !<command> to execute debugger commands
  • Type /<event> to send custom events
  • Press empty Enter to check for async actions
  • Press Ctrl+C to exit

Debugger Commands (Colang 2.x)

Custom Events (Colang 2.x)

Send custom events:

Configuration Requirements

Colang 1.0

Minimal config.yml:

Colang 2.x

Minimal config.yml:

Example Session

Streaming Example

Verbose Output Example

Troubleshooting

Config Not Found

Make sure your config directory exists:
It should contain:
  • config.yml or config.yaml
  • At least one .co file (for Colang flows)

Streaming Not Supported

If you get a StreamingNotSupportedError:
  1. Add to your config.yml:
  1. Or remove the --streaming flag

Model Not Found

Ensure your API key is set:
Or for other providers:

Connection Error (Server Mode)

Check if server is running:
Start server if needed:

Advanced Usage

Testing Specific Rails

Create a test config with only specific rails:
config.yml

Debugging Flow Execution

Use debug mode to see detailed flow execution:

Testing with Mock Data

Set deterministic random seed for testing:

Best Practices

  1. Start Simple: Begin with --verbose-no-llm to see flow execution without LLM noise
  2. Use Streaming: Enable streaming for better UX when testing long responses
  3. Debug Incrementally: Use debug levels progressively (INFO → DEBUG)
  4. Test Rails: Chat is great for testing how rails behave with different inputs
  5. Use Server Mode: Test against a server to verify production-like behavior