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:

  1. Restart a service (after making changes)
  2. Immediately see its output and logs
  3. 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

  1. 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
  2. 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

CommandPurposeLogsAll Services
runnem restartRestart servicesNoYes/Single
runnem rerunRestart + logsYesSingle only
runnem runStart + logsYesSingle 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

  1. Use rerun after making code or configuration changes
  2. Use regular restart when restarting multiple services
  3. Press Ctrl+C to stop viewing logs (service continues running)
  4. Monitor startup messages for any configuration issues
  5. Watch for error patterns in the log output

Next Steps

Previous
runnem restart