Keep personal changes out of Git
Use this guide when you want the project to run a little differently on your machine, such as one service off or a debug log level, without changing the project file the team shares.
::example{slug="workflows-dev-and-prod"}
Create the local file
Section titled “Create the local file”The local file is devlanes.local.yaml, next to devlanes.yaml. It takes the same keys and holds only what you change, merged over the project file:
services: web: autostart: false api: env: LOG_LEVEL: debug scratch: run_script: file: apps/scratch/package.json name: dev hosts: "scratch.${{ lane.domain }}"servicesLong-running processes of each lane, started together after infrastructure, setup and lane.start tasks. Each service gets its own port as PORT and, with hosts, HTTPS hostnames. A service that exits shows as failed and is not restarted.
services.<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.
services.<name>.autostartSet false for an on-demand service: a plain devlanes start without a default profile skips it unless the lane ran it before, and so do globs such as * in profiles. Naming it or its +tag, on the command line or in a profile, still starts it. An expression is evaluated for each lane and acts like the true or false it gives, such as ${{ lane.index == 0 }} to autostart only in the main lane. With replicas, the service starts all its copies when any copy's expression gives true. Defaults to true.
services.<name>.envEnvironment variables for this service's process. They override global_env and are overridden by the active profile's env and --env; values may be text, numbers, booleans or ${{ ... }} expressions. Setting PORT replaces the port devlanes allocated; a literal number is the same in every lane, so lanes collide.
services.<name>.env.<name>Environment variables for this service's process. They override global_env and are overridden by the active profile's env and --env; values may be text, numbers, booleans or ${{ ... }} expressions. Setting PORT replaces the port devlanes allocated; a literal number is the same in every lane, so lanes collide.
services.<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.
services.<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.
services.<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.
services.<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.
Here a plain start leaves the web service out unless the lane ran it before or you name it, the API gets one more variable and keeps the rest, and a service only you run joins the lane. The local file cannot set project or a file-level extends. Config files and reload has the merge rules.
Keep it out of Git
Section titled “Keep it out of Git”devlanes does not touch your .gitignore, so add the file yourself:
devlanes*.local.yamlApply the change
Section titled “Apply the change”$ devlanes reloadThe reload restarts the services your edit changed. A new worktree has no local file of its own and reads the primary worktree’s, as Files and folders describes.
If one worktree needs other changes
Section titled “If one worktree needs other changes”Create a local file in that worktree. Its lanes read that file instead of the primary worktree’s, and the two are not merged.
If you use a second project file
Section titled “If you use a second project file”Each project file has its own local file, named after it: devlanes.prod.yaml reads devlanes.prod.local.yaml. Run dev servers and a production build side by side sets up such a pair.