Skip to main content
The rf test command starts a local development server with a web interface for testing your agents. Features live reload, real-time monitoring, and zero configuration.

Basic Usage

Features

  • ⚑ Zero configuration - Auto-detects agent from .runflow/rf.json
  • πŸ”„ Live reload - Automatically restarts on file changes
  • 🌐 Web portal with real-time monitoring
  • πŸš€ Auto browser - Opens automatically at http://localhost:PORT
  • πŸ“Š Traces storage - Saved locally in .runflow/traces.json
  • 🎯 Smart ports - Auto-selects available port (3000-4000)

Options

Examples

Start Test Server

The web interface will automatically open at:

Specify Port

Access at: http://localhost:4500/agents/your-agent/test-monitor

Without Browser

Then manually open: http://localhost:PORT/agents/your-agent/test-monitor

How It Works

  1. Auto-detection: The CLI reads .runflow/rf.json in the current directory to identify the agent
  2. Port Selection: Automatically finds an available port between 3000-4000
  3. Web Server: Starts a local server with full observability features
  4. Browser: Opens the test monitor interface automatically (unless --no-browser is used)
  5. File Watcher: Monitors your code for changes
  6. Live Reload: Automatically restarts on file save
  7. Real-time Monitoring: See execution traces, costs, and performance metrics in real-time
  8. Local Storage: All traces are saved to .runflow/traces.json for analysis

Live Reload

The test server automatically detects file changes and reloads:
Watched files:
  • All .ts and .js files in src/
  • package.json
  • .runflow/rf.json
No need to restart the server! Just save your files and test.

Web Interface Features

The local web portal provides:
  • πŸ“Š Real-time execution monitoring
  • πŸ’° Cost tracking (tokens and costs per execution)
  • ⏱️ Performance metrics (duration, latency)
  • πŸ” Trace inspection (full execution details)
  • πŸ§ͺ Interactive testing (send test messages)
  • πŸ“ Execution history (stored locally)
  • πŸ”„ Live reload status (shows when code changes)

Testing Workflow

Development Best Practices

Rapid Iteration

Testing with Knowledge Base

Debugging

The web interface shows detailed traces:

Local Traces

All execution traces are saved to .runflow/traces.json in a structured format:
This allows you to:
  • Analyze execution patterns
  • Debug issues offline
  • Track performance over time
  • Compare different executions

Troubleshooting

Port Already in Use

If you see a port conflict error:

Agent Not Detected

Make sure you’re in the agent directory with .runflow/rf.json:
Error:
Solution: Navigate to correct directory or run rf agents clone first.

Browser Doesn’t Open

If the browser doesn’t open automatically:

Live Reload Not Working

If changes aren’t detected:
  1. Check file location - Only files in src/ are watched
  2. Save file properly - Ensure file is actually saved
  3. Check console - Look for reload messages
  4. Restart server - Press Ctrl+C and run rf test again

Dependencies Not Installed

Solution:

API Key Missing

Solution:

Traces Not Saving

If traces aren’t saved to .runflow/traces.json:
  1. Check permissions - Ensure write access to .runflow/
  2. Check disk space - Ensure sufficient space
  3. Check file - cat .runflow/traces.json

Advanced Usage

Custom Port

Multiple Agents

CI/CD Testing

Performance Tips

Fast Iteration

  • Keep server running - don’t restart
  • Use live reload - save and test
  • Monitor console for reload status
  • Check traces for bottlenecks

Debugging Slow Responses

The web interface shows timing breakdown:
Identify and optimize slow components.

Next Steps

Agents

Deploy your tested agent

Knowledge Base

Test with knowledge base

Prompts

Test prompt changes

Observability

Learn about observability features