Commands
runagent serve
Start local development server for testing agents
Synopsis
Description
The serve
command starts a local FastAPI server for testing your agent before deployment. It provides hot reload, logging, and debugging capabilities.
Options
Option | Description | Default |
---|---|---|
--port , -p | Port to run server on | 8000 |
--host , -h | Host to bind to | 127.0.0.1 |
--reload | Enable auto-reload | true in dev |
--no-reload | Disable auto-reload | - |
--workers , -w | Number of worker processes | 1 |
--log-level | Logging level | info |
Examples
Basic Usage
Advanced Usage
Available Endpoints
Once running, your agent exposes:
Endpoint | Method | Description |
---|---|---|
/ | GET | Welcome page |
/health | GET | Health check |
/invoke | POST | Invoke agent |
/stream | POST | Stream responses |
/docs | GET | API documentation |
Testing Your Agent
Health Check
Invoke Agent
Stream Response
Development Features
Hot Reload
Changes to your agent code automatically restart the server:
Request Logging
All requests are logged with details:
Error Display
Errors show full traceback in development:
Configuration
The server reads from runagent.config.json
:
Troubleshooting
See Also
runagent deploy
- Deploy to productionrunagent logs
- View logs