CLI Reference
runnem rerun
Restart a service and immediately view its logs.
Usage
runnem rerun <service>
Description
The rerun
command is a convenient combination of runnem restart
and runnem log
that restarts a specific service and immediately begins streaming its logs. This is perfect for development workflows where you want to:
- Restart a service (after making changes)
- Immediately see its output and logs
- Monitor its behavior in real-time
Note: Like runnem run
, the rerun
command requires a service name - you cannot rerun all services at once. This keeps the command focused and the log output manageable.
Examples
# Restart the API service and view its logs
runnem rerun api
# Restart the frontend after making changes
runnem rerun frontend
# Restart a worker service and monitor its activity
runnem rerun worker
How it works
Service Restart:
- Gracefully stops the specified service (if running)
- Waits briefly to ensure clean shutdown
- Starts the service again with fresh state
- Handles any startup errors
Log Streaming:
- Immediately begins streaming logs from the restarted service
- Shows both stdout and stderr output
- Continues until you press Ctrl+C
- Uses the same log viewing logic as
runnem log
Service Status
During restart, you'll see status messages followed by log output:
- π Restarting service...
- π Stopped service
- π Starting service...
- β Started service (with URL if configured)
- π Viewing logs for service...
- [Log output begins streaming]
When to Use Rerun
The rerun
command is ideal when:
- You've made changes to service code or configuration
- A service is unresponsive and needs a fresh start
- Testing configuration changes with immediate feedback
- Debugging service restart behavior
- You want to ensure a clean service state with logs
Comparison with Other Commands
Command | Purpose | Logs | All Services |
---|---|---|---|
runnem restart | Restart services | No | Yes/Single |
runnem rerun | Restart + logs | Yes | Single only |
runnem run | Start + logs | Yes | Single only |
Development Workflow
A typical development workflow with rerun
:
# 1. Make changes to your service code
vim src/api.py
# 2. Restart and immediately see the results
runnem rerun api
# 3. Watch logs for any issues or confirmations
# 4. Press Ctrl+C when satisfied (service keeps running)
Best Practices
- Use
rerun
after making code or configuration changes - Use regular
restart
when restarting multiple services - Press Ctrl+C to stop viewing logs (service continues running)
- Monitor startup messages for any configuration issues
- Watch for error patterns in the log output
Next Steps
- runnem run - Start a service and view logs
- runnem restart - Restart services without logs
- runnem log - View logs without restarting services
- Service Management - Understand service lifecycle management