Configuration

YAML Configuration

runnem uses a simple YAML-based configuration file (runnem.yaml) to define your project's services and their relationships.

Basic Structure

The configuration file has two main sections:

project_name: myproject  # Required: Your project's name

services:  # Required: Dictionary of services
  service_name:  # Key: Name of the service
    command: string  # Required: Command to run the service
    url: string     # Optional: URL to check if service is running
    depends_on:     # Optional: List of service dependencies
      - other_service

Service Configuration

Each service can have the following configuration options:

Required Fields

  • command: The command to run the service
    api:
      command: cd ~/projects/myproject/api && npm run dev
    

Optional Fields

  • url: URL to check if the service is running

    api:
      url: http://localhost:3000
    
  • depends_on: List of services this service depends on

    frontend:
      depends_on: ["api"]
    

Example Configurations

Simple Project

project_name: myproject

services:
  api:
    command: cd ~/projects/myproject/api && npm run dev
    url: http://localhost:3000

  frontend:
    command: cd ~/projects/myproject/frontend && npm run dev
    url: http://localhost:3001
    depends_on: ["api"]

Complex Project

project_name: ecommerce

services:
  database:
    command: cd ~/projects/ecommerce/database && docker-compose up
    url: postgresql://localhost:5432

  redis:
    command: cd ~/projects/ecommerce/redis && docker-compose up
    url: redis://localhost:6379

  api:
    command: cd ~/projects/ecommerce/api && npm run dev
    url: http://localhost:3000
    depends_on: ["database", "redis"]

  frontend:
    command: cd ~/projects/ecommerce/frontend && npm run dev
    url: http://localhost:3001
    depends_on: ["api"]

  worker:
    command: cd ~/projects/ecommerce/worker && npm run start
    depends_on: ["redis"]

Best Practices

  1. Use descriptive service names
  2. Define URLs for services when possible
  3. Keep dependency chains simple
  4. Use absolute paths in commands
  5. Group related services together
  6. Comment complex configurations
  7. Keep the configuration in version control

Validation

runnem validates your configuration:

  • Checks for required fields
  • Validates service dependencies
  • Detects circular dependencies
  • Verifies URL formats
Previous
Logs & Monitoring