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 serviceapi: command: cd ~/projects/myproject/api && npm run dev
Optional Fields
url
: URL to check if the service is runningapi: url: http://localhost:3000
depends_on
: List of services this service depends onfrontend: 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
- Use descriptive service names
- Define URLs for services when possible
- Keep dependency chains simple
- Use absolute paths in commands
- Group related services together
- Comment complex configurations
- Keep the configuration in version control
Validation
runnem validates your configuration:
- Checks for required fields
- Validates service dependencies
- Detects circular dependencies
- Verifies URL formats