tasks in devlanes.yaml
A top-level key of devlanes.yaml.
Type: mapping of names to mappings.
One-shot commands such as installs, migrations and seeds, run by hand with devlanes run <name> or automatically at a lane event set with when. Tasks of the same event run in declaration order.
tasks: migrate: run_script: file: apps/api/package.json name: migrate when: lane.starttasksOne-shot commands such as installs, migrations and seeds, run by hand with devlanes run <name> or automatically at a lane event set with when. Tasks of the same event run in declaration order.
tasks.<name>A one-shot command, run by hand with devlanes run <name> or automatically at a lane event set with when. Anything that ends by itself belongs here, not in services, where an exit counts as a failure.
tasks.<name>.run_scriptScript to run from a project file, as { file, name }, such as { file: apps/api/package.json, name: migrate }. It runs with that file's tool (the project's package manager for package.json) in the file's directory, and a missing script fails before anything starts. Prefer it to run for scripts that live in a file. Use exactly one of run, run_script or steps.
tasks.<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.
tasks.<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.
tasks.<name>.whenLane event that runs this task automatically. Without it the task runs only by hand with devlanes run <name> or as a step of another task.
tasks.<name>
Section titled “tasks.<name>”Type: mapping.
A one-shot command, run by hand with devlanes run <name> or automatically at a lane event set with when. Anything that ends by itself belongs here, not in services, where an exit counts as a failure.
tasks: migrate: run_script: file: apps/api/package.json name: migrate when: lane.starttasksOne-shot commands such as installs, migrations and seeds, run by hand with devlanes run <name> or automatically at a lane event set with when. Tasks of the same event run in declaration order.
tasks.<name>A one-shot command, run by hand with devlanes run <name> or automatically at a lane event set with when. Anything that ends by itself belongs here, not in services, where an exit counts as a failure.
tasks.<name>.run_scriptScript to run from a project file, as { file, name }, such as { file: apps/api/package.json, name: migrate }. It runs with that file's tool (the project's package manager for package.json) in the file's directory, and a missing script fails before anything starts. Prefer it to run for scripts that live in a file. Use exactly one of run, run_script or steps.
tasks.<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.
tasks.<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.
tasks.<name>.whenLane event that runs this task automatically. Without it the task runs only by hand with devlanes run <name> or as a step of another task.
tasks.<name>.after
Section titled “tasks.<name>.after”Type: services.
Set to services to run a lane.create or lane.start task after the started services are ready instead of before them, for work that goes through the running app, such as seeding through its API.
Values:
services: Run once every started service is ready; the task is skipped when one of them failed or the start timed out.
tasks: migrate: after: servicestasksOne-shot commands such as installs, migrations and seeds, run by hand with devlanes run <name> or automatically at a lane event set with when. Tasks of the same event run in declaration order.
tasks.<name>A one-shot command, run by hand with devlanes run <name> or automatically at a lane event set with when. Anything that ends by itself belongs here, not in services, where an exit counts as a failure.
tasks.<name>.afterSet to services to run a lane.create or lane.start task after the started services are ready instead of before them, for work that goes through the running app, such as seeding through its API.
tasks.<name>.confirm
Section titled “tasks.<name>.confirm”Type: string or an expression.
Question asked before the task runs, for destructive tasks. Scripts and agents without a terminal must pass --yes to run it.
tasks: migrate: confirm: Reset ${{ lane.db_name }} and re-seed it?tasksOne-shot commands such as installs, migrations and seeds, run by hand with devlanes run <name> or automatically at a lane event set with when. Tasks of the same event run in declaration order.
tasks.<name>A one-shot command, run by hand with devlanes run <name> or automatically at a lane event set with when. Anything that ends by itself belongs here, not in services, where an exit counts as a failure.
tasks.<name>.confirmQuestion asked before the task runs, for destructive tasks. Scripts and agents without a terminal must pass --yes to run it.
tasks.<name>.cwd
Section titled “tasks.<name>.cwd”Type: string or an expression.
Working directory for run, relative to the project file’s directory in the lane’s worktree; defaults to that directory. Cannot be combined with run_script, which runs in the script file’s directory.
tasks: migrate: cwd: apps/apitasksOne-shot commands such as installs, migrations and seeds, run by hand with devlanes run <name> or automatically at a lane event set with when. Tasks of the same event run in declaration order.
tasks.<name>A one-shot command, run by hand with devlanes run <name> or automatically at a lane event set with when. Anything that ends by itself belongs here, not in services, where an exit counts as a failure.
tasks.<name>.cwdWorking directory for run, relative to the project file's directory in the lane's worktree; defaults to that directory. Cannot be combined with run_script, which runs in the script file's directory.
tasks.<name>.env
Section titled “tasks.<name>.env”Type: mapping of names to strings, booleans, numbers or expressions.
Variables for this task only, above global_env.
tasks: migrate: env: API_URL: ${{ services.api.url }}tasksOne-shot commands such as installs, migrations and seeds, run by hand with devlanes run <name> or automatically at a lane event set with when. Tasks of the same event run in declaration order.
tasks.<name>A one-shot command, run by hand with devlanes run <name> or automatically at a lane event set with when. Anything that ends by itself belongs here, not in services, where an exit counts as a failure.
tasks.<name>.interactive
Section titled “tasks.<name>.interactive”Type: boolean or an expression.
Give the task your terminal for input and output, for logins, prompts and TUIs. Interactive tasks only run by hand, so they cannot have when. Defaults to false.
tasks: migrate: interactive: truetasksOne-shot commands such as installs, migrations and seeds, run by hand with devlanes run <name> or automatically at a lane event set with when. Tasks of the same event run in declaration order.
tasks.<name>A one-shot command, run by hand with devlanes run <name> or automatically at a lane event set with when. Anything that ends by itself belongs here, not in services, where an exit counts as a failure.
tasks.<name>.interactiveGive the task your terminal for input and output, for logins, prompts and TUIs. Interactive tasks only run by hand, so they cannot have when. Defaults to false.
tasks.<name>.profiles
Section titled “tasks.<name>.profiles”Type: list of strings.
Run this task’s when hook only while one of these profiles is active; default also matches a start without --profile. Runs by hand are not affected. Requires when.
tasks: migrate: profiles: - default - backendtasksOne-shot commands such as installs, migrations and seeds, run by hand with devlanes run <name> or automatically at a lane event set with when. Tasks of the same event run in declaration order.
tasks.<name>A one-shot command, run by hand with devlanes run <name> or automatically at a lane event set with when. Anything that ends by itself belongs here, not in services, where an exit counts as a failure.
tasks.<name>.profilesRun this task's when hook only while one of these profiles is active; default also matches a start without --profile. Runs by hand are not affected. Requires when.
tasks.<name>.pty
Section titled “tasks.<name>.pty”Type: boolean or an expression.
Run the task in a pseudoterminal instead of plain pipes, for tools that only print colors or progress to a terminal. Defaults to the value of interactive.
tasks: migrate: pty: truetasksOne-shot commands such as installs, migrations and seeds, run by hand with devlanes run <name> or automatically at a lane event set with when. Tasks of the same event run in declaration order.
tasks.<name>A one-shot command, run by hand with devlanes run <name> or automatically at a lane event set with when. Anything that ends by itself belongs here, not in services, where an exit counts as a failure.
tasks.<name>.ptyRun the task in a pseudoterminal instead of plain pipes, for tools that only print colors or progress to a terminal. Defaults to the value of interactive.
tasks.<name>.run
Section titled “tasks.<name>.run”Type: string, list of strings or an expression.
Command to run: a string runs through /bin/sh -c (pipes and multi-line scripts work), a list runs the program directly with those arguments. Use exactly one of run, run_script or steps. In a list, an item that is one ${{ }} expression giving a number or true/false becomes its text, such as --port followed by ${{ self.port }}.
tasks: migrate: run: pnpm devtasksOne-shot commands such as installs, migrations and seeds, run by hand with devlanes run <name> or automatically at a lane event set with when. Tasks of the same event run in declaration order.
tasks.<name>A one-shot command, run by hand with devlanes run <name> or automatically at a lane event set with when. Anything that ends by itself belongs here, not in services, where an exit counts as a failure.
tasks.<name>.runCommand to run: a string runs through /bin/sh -c (pipes and multi-line scripts work), a list runs the program directly with those arguments. Use exactly one of run, run_script or steps. In a list, an item that is one ${{ }} expression giving a number or true/false becomes its text, such as --port followed by ${{ self.port }}.
tasks.<name>.run_script
Section titled “tasks.<name>.run_script”Type: mapping.
Script to run from a project file, as { file, name }, such as { file: apps/api/package.json, name: migrate }. It runs with that file’s tool (the project’s package manager for package.json) in the file’s directory, and a missing script fails before anything starts. Prefer it to run for scripts that live in a file. Use exactly one of run, run_script or steps.
Takes the same keys as services.<name>.run_script.
tasks: migrate: run_script: file: apps/api/package.json name: devtasksOne-shot commands such as installs, migrations and seeds, run by hand with devlanes run <name> or automatically at a lane event set with when. Tasks of the same event run in declaration order.
tasks.<name>A one-shot command, run by hand with devlanes run <name> or automatically at a lane event set with when. Anything that ends by itself belongs here, not in services, where an exit counts as a failure.
tasks.<name>.run_scriptScript to run from a project file, as { file, name }, such as { file: apps/api/package.json, name: migrate }. It runs with that file's tool (the project's package manager for package.json) in the file's directory, and a missing script fails before anything starts. Prefer it to run for scripts that live in a file. Use exactly one of run, run_script or steps.
tasks.<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.
tasks.<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.
tasks.<name>.steps
Section titled “tasks.<name>.steps”Type: list of strings.
Run these tasks and infra.setup.<name> or infra.teardown.<name> entries in order, stopping at the first failure, for jobs such as resetting a database. Each step runs whatever its own when says, and setup entries run again even when already done. Use instead of run or run_script.
tasks: migrate: steps: - infra.teardown.database - infra.setup.database - migrate - seedtasksOne-shot commands such as installs, migrations and seeds, run by hand with devlanes run <name> or automatically at a lane event set with when. Tasks of the same event run in declaration order.
tasks.<name>A one-shot command, run by hand with devlanes run <name> or automatically at a lane event set with when. Anything that ends by itself belongs here, not in services, where an exit counts as a failure.
tasks.<name>.stepsRun these tasks and infra.setup.<name> or infra.teardown.<name> entries in order, stopping at the first failure, for jobs such as resetting a database. Each step runs whatever its own when says, and setup entries run again even when already done. Use instead of run or run_script.
tasks.<name>.timeout
Section titled “tasks.<name>.timeout”Type: duration or an expression.
Longest the task may run. When it runs out, the task is stopped (SIGTERM, then SIGKILL after 10 seconds) and counts as failed; a failed task that runs before services fails the start. No limit by default.
tasks: migrate: timeout: 15stasksOne-shot commands such as installs, migrations and seeds, run by hand with devlanes run <name> or automatically at a lane event set with when. Tasks of the same event run in declaration order.
tasks.<name>A one-shot command, run by hand with devlanes run <name> or automatically at a lane event set with when. Anything that ends by itself belongs here, not in services, where an exit counts as a failure.
tasks.<name>.timeoutLongest the task may run. When it runs out, the task is stopped (SIGTERM, then SIGKILL after 10 seconds) and counts as failed; a failed task that runs before services fails the start. No limit by default.
Config referencetasks.<name>.when
Section titled “tasks.<name>.when”Type: string.
Lane event that runs this task automatically. Without it the task runs only by hand with devlanes run <name> or as a step of another task.
Values:
lane.create: Run on each start until it has succeeded once for the lane, then no longer automatically; for installs, code generation and a first seed.lane.start: Run on every start of the lane, before services unlessafter: servicesis set; for migrations and other steps that are safe to repeat.lane.stop: Run before the lane’s processes stop when the whole lane stops:devlanes stopwithout unit names,devlanes daemon stopanddaemon restart. Skipped when a signal (logout, system shutdown) stops the daemon.lane.clean: Run when the lane is cleaned (devlanes lane clean), after its processes stop and beforeinfra.teardown.
tasks: migrate: when: lane.createtasksOne-shot commands such as installs, migrations and seeds, run by hand with devlanes run <name> or automatically at a lane event set with when. Tasks of the same event run in declaration order.
tasks.<name>A one-shot command, run by hand with devlanes run <name> or automatically at a lane event set with when. Anything that ends by itself belongs here, not in services, where an exit counts as a failure.
tasks.<name>.whenLane event that runs this task automatically. Without it the task runs only by hand with devlanes run <name> or as a step of another task.