Project YAML Reference
Structure and fields of project definition files, plus the optional .kovra.yaml file inside repositories.
Each project is stored as a YAML file in the data directory at projects/<id>.yaml (see Data Directory). Most fields are managed through the UI, though you can edit the file directly. Here is a complete example:
id: shop
name: Shop
repos:
- name: web
path: C:/code/web # Main repository directory
services:
web:
launcher: vite # Launcher type; cmd is used only when set to custom
port: 3000 # Default port (used by the main environment)
port_env: VITE_DEV_PORT # Env var the process reads its port from
script: dev:local # Optional: which package.json script to run
links: # Service links: which service this env var points to
- { env: VITE_API_PROXY_TARGET, service: api/api, auto: true }
- name: auth
path: C:/code/auth
services:
api: { launcher: custom, cmd: "python run.py", port: 8000 } # No port_env: hardcoded port, single-instance only
envs: # Which directory each environment uses
- id: 682-login
name: Login Redesign
hidden: false
auto: true # Auto-grouped; becomes false after manual edits
members: { web: C:/code/web_682, api: null, auth: null } # null = borrow from main environment
ports: # Ports assigned to services in other environments, tracked per worktree
c:/code/web_682: { web/web: 3010 }
settings:
dir_pattern: "{repo}_{env}" # Directory naming pattern for new worktrees
branch_pattern: "feature/{env}" # Branch naming pattern for new environments
copy_files: [".env", ".env.*", "application-local.*", "config.local.*", "local.settings.json"]
auto_prepare: true
Main Fields
| Field | Description |
|---|---|
repos |
List of repositories in the project. Each has name, path (main directory), and services. |
services |
Map of services in the repository, keyed by service name. |
launcher |
Launcher type; see Supported Stacks. Uses cmd when set to custom. |
cmd |
Custom start command. {{port}} is replaced with the environment’s assigned port. |
port |
Default port, used in the main environment. |
port_env |
Environment variable the app reads its port from. Services with port_env can run multiple instances; services without it and with a hardcoded port are single-instance only. |
script |
Which package.json script to execute. |
links |
Connections between services (see below). |
envs |
Directory mapping for each environment. Repositories set to null in members borrow from the main environment. |
ports |
Service ports for non-main environments, persisted per worktree path. |
settings |
Naming patterns for new environments, local config files to copy, and auto-prepare preference. |
Services also support these optional fields:
profile: Spring profile name.env: Additional environment variables.wait_for: Another service to wait for before starting (none by default).change_port: false: Forces the service to be single-instance only.ready_log: Log pattern to match when determining readiness (can only be configured in this file).
Service Links (links)
Each link entry has the shape { env, service, host?, auto?, mode? }:
env: Environment variable name to set.service: Target service inrepo/serviceformat.host: Optional host override.auto: Whether the link was auto-detected by Kovra.mode:appendorreplace. When omitted, inferred from the variable’s original value in the project; see Ports & Service Links.
Repository .kovra.yaml
You can place an optional .kovra.yaml file in a repository root containing services: { <service-name>: <service-definition> } using the same format as above. Teammates get the configuration immediately after pulling, and it takes precedence over auto-detection.
Kovra never writes to your repositories.