templates in devlanes.yaml
A top-level key of devlanes.yaml.
templates
Section titled “templates”Type: mapping of names to mappings.
Named service settings that services reuse with extends: <template>. The service inherits every setting of the template and its own settings win: mappings (env, ready, stop, preset options, run_script) merge by key, lists (tags, hosts, sync) and single values replace. Setting run or run_script drops the inherited other one, and one ready probe (tcp, http, log, cmd) drops the inherited probe. Templates may extend other templates, are never started themselves, and are applied after every project file and local override is merged.
templates: fastify-api: platform: node ready: http: path: /-/health tags: - apitemplatesNamed service settings that services reuse with extends: <template>. The service inherits every setting of the template and its own settings win: mappings (env, ready, stop, preset options, run_script) merge by key, lists (tags, hosts, sync) and single values replace. Setting run or run_script drops the inherited other one, and one ready probe (tcp, http, log, cmd) drops the inherited probe. Templates may extend other templates, are never started themselves, and are applied after every project file and local override is merged.
templates.<name>A long-running process started with the lane, such as a dev server or a worker. Each service gets its own port from the lane's block (PORT, ${{ self.port }}); devlanes stops it with the lane and never restarts it when it exits. A service needs run or run_script, directly or through extends.
templates.<name>.platformRuntime of the service: node, bun, deno, python, rust, go or java. It decides which variables devlanes adds, such as the devlanes CA (NODE_EXTRA_CA_CERTS, SSL_CERT_FILE, a trust store in JAVA_TOOL_OPTIONS) and color settings. Detected from the run_script file or the working directory when omitted; set it only when detection is wrong, such as java for a java -jar command in a folder without a pom.xml or Gradle file. none skips detection and adds no platform variables.
templates.<name>.readyWhen the service counts as up: once its check passed and it has run half a second. devlanes start waits for it, and after: services tasks run once every started service is ready. Write started (no probe) or a mapping with one of tcp, http, log or cmd, plus timeout (default 60s). Without it, a service with hosts waits for TCP on its port and one without hosts uses started. A service that exits within that half second failed to start. A check that times out marks the service failed, which also skips after: services tasks; the process keeps running and is not restarted.
templates.<name>.ready.httpReady once a GET request to path on the unit's main port answers with status, or with a 2xx status when status is unset. Redirects are not followed. Best when the app has a health route that fails while it is broken. Each request sends User-Agent: devlanes-ready, so an app can leave the checks out of its request logs.
templates.<name>.ready.http.pathPath requested with GET, such as /healthz; defaults to /.
templates.<name>.tagsLabels for selecting and grouping services. +tag selects every service with the tag in profiles, in commands such as devlanes start +api, and in the TUI filter. Tags also set the service's color: the first tag with a color under the top-level tags wins, then the first tag naming a category such as api, web or worker, so put that tag first.
templates.<name>
Section titled “templates.<name>”Type: mapping.
A long-running process started with the lane, such as a dev server or a worker. Each service gets its own port from the lane’s block (PORT, ${{ self.port }}); devlanes stops it with the lane and never restarts it when it exits. A service needs run or run_script, directly or through extends.
Takes the same keys as services.<name>.
templates: fastify-api: hosts: api.${{ lane.domain }} run_script: file: apps/api/package.json name: dev tags: - apitemplatesNamed service settings that services reuse with extends: <template>. The service inherits every setting of the template and its own settings win: mappings (env, ready, stop, preset options, run_script) merge by key, lists (tags, hosts, sync) and single values replace. Setting run or run_script drops the inherited other one, and one ready probe (tcp, http, log, cmd) drops the inherited probe. Templates may extend other templates, are never started themselves, and are applied after every project file and local override is merged.
templates.<name>A long-running process started with the lane, such as a dev server or a worker. Each service gets its own port from the lane's block (PORT, ${{ self.port }}); devlanes stops it with the lane and never restarts it when it exits. A service needs run or run_script, directly or through extends.
templates.<name>.hostsHostnames the devlanes HTTPS proxy routes to this service, so https://<host> reaches it. One entry or a list; an entry is a hostname or a mapping with host and optional port (a named port), fallback and host_header. A *. wildcard matches subdomains, and an exact host wins over it. The first non-wildcard host becomes public_url, non-wildcard hosts join the lane's DEVLANES_ORIGINS, and having hosts makes the default ready a TCP check. Keep them under ${{ lane.domain }} so lanes do not collide.
templates.<name>.run_scriptScript to run from a project file, as { file, name }, such as { file: apps/api/package.json, name: dev }. devlanes picks the tool from the file name (package.json, Makefile, justfile, Taskfile.yml, deno.json, pyproject.toml, Cargo.toml, go.mod, pom.xml, build.gradle(.kts), settings.gradle(.kts)), runs the script in that file's directory and checks that it exists before starting. For Maven and Gradle, name is the arguments as typed after mvn or gradle, and Maven or Gradle reports a goal or task that does not exist. Presets need it to place their flags, and a profile's run_scripts can swap the script name. Exactly one of run and run_script is required after templates are applied.
templates.<name>.run_script.fileFile that defines the script, relative to the project file's directory, such as apps/api/package.json. The script runs in this file's directory. Required unless an override or extends child keeps the inherited file.
templates.<name>.run_script.nameScript, target, recipe, task, binary or package name in that file. For go.mod, a bare name such as api means ./cmd/api, and . or a path with / is relative to go.mod. For pom.xml and Gradle files it is the arguments as typed after mvn or gradle, such as -pl web -am spring-boot:run or :web:bootRun; quote an argument that contains spaces, as in a shell. It must name at least one goal or task. Required unless an override or extends child keeps the inherited name.
templates.<name>.tagsLabels for selecting and grouping services. +tag selects every service with the tag in profiles, in commands such as devlanes start +api, and in the TUI filter. Tags also set the service's color: the first tag with a color under the top-level tags wins, then the first tag naming a category such as api, web or worker, so put that tag first.