Skip to content

devlanes is in beta and not ready for production use.Report an issue

Add devlanes to a project

You need devlanes on your machine, as Install devlanes sets it up, and the ideas from A service, a port and a hostname.

Use this guide when your project starts today with a dev script or a few terminals. A coding agent with the devlanes skill can do all of it for you; Set up a coding agent gives it the skill.

::example{slug="basics-hello-node"}

Create devlanes.yaml at the root of the repository. Each long-running command becomes a service that points at its script, a service you open in a browser gets a hostname, and the ready check names a route that answers once the app works.

devlanes.yaml
project: myapp
services:
api:
run_script:
file: api/package.json
name: dev
hosts: "api.${{ lane.domain }}"
ready:
http:
path: /healthz

The project name goes into the lane’s domain and is shared by every worktree, so choose one you will keep. Run scripts your project already has covers other script files and plain commands.

devlanes passes each service its port in PORT and the loopback address in HOST. Read both where the server starts listening. A server that keeps a fixed port of its own never passes its ready check.

api/server.mjs
const port = Number(process.env.PORT ?? 3000);
const host = process.env.HOST ?? "127.0.0.1";
server.listen(port, host);

Run a service in its runtime has the same lines for other runtimes.

Terminal window
$ devlanes config check
$ devlanes start --no-ui

The check points at the line of any mistake. The start runs the script, waits for the ready check and prints the hostname to open. Commit the file, so every worktree of the repository has it.

Pass the port with an expression. For Vite and Next.js a preset adds the flags, as Run Vite and Next.js shows, and for Spring Boot and Quarkus a preset sets the variables, as Run Spring Boot and Quarkus shows.

devlanes.yaml
services:
api:
run: node server.mjs --port ${{ self.port }}

Migrate from another process manager turns an mprocs, Procfile or Compose setup into a project file.