---
title: "Run scripts your project already has"
url: https://devlanes.run/docs/how-to/projects/run-scripts/
description: "Start a service or a task from a script in package.json, a Makefile, a justfile, a Taskfile, Cargo.toml, pyproject.toml, deno.json or go.mod, or from Maven goals and Gradle tasks, and know when a plain command fits better."
updated: 2026-11-16T11:43:03.000Z
---

# Run scripts your project already has

Use this guide when the commands your project runs are already scripts, targets, recipes or tasks in one of its own files, so the command stays written in one place.

## Point the service at the script

Name the file, relative to the project file, and the script in it. The script runs in that file's folder, the way it does from a terminal there. Tasks take the same two keys.

```yaml devlanes
services:
  api:
    run_script:
      file: apps/api/package.json
      name: dev
```

The file name picks the tool:

- `package.json`: the script, with the package manager the project declares in `packageManager` or its lockfile.
- A Makefile: `make <target>`.
- A justfile: `just <recipe>`.
- A Taskfile (`Taskfile.yml`, `Taskfile.yaml`, `Taskfile.dist.yml` or `Taskfile.dist.yaml`, also in lowercase): `task <name>`. The task gets a preset's flags in `{{.CLI_ARGS}}`. devlanes runs `task`, so on Arch Linux, where the binary is `go-task`, put a `task` link to it on your `PATH`.
- `Cargo.toml`: `cargo run --bin <name>`, where the name is a binary.
- `pyproject.toml`: an entry under `[project.scripts]`, run with uv or Poetry.
- `deno.json`: `deno task <name>`.
- `go.mod`: `go run ./cmd/<name>`, where the name is a folder under `cmd`. `.` or a name with a `/`, such as `tools/seed`, is a package path from the go.mod folder.
- `pom.xml`: Maven, with the name as the goals and options you would type after `mvn`, such as `spring-boot:run -Pdev`.
- `build.gradle`, `build.gradle.kts`, `settings.gradle` or `settings.gradle.kts`: Gradle, with the name as the tasks and options you would type after `gradle`, such as `:web:bootRun`.

A start checks that the script exists and lists the names the file has when it does not. Maven and Gradle report a goal or task that does not exist themselves, and the service shows as failed.

## Run Maven goals and Gradle tasks

devlanes runs the nearest `mvnw` or `gradlew` between the file's folder and the worktree's root, and `mvn` or `gradle` when there is none. Quote an argument that contains spaces, as in a shell:

```yaml devlanes
services:
  api:
    run_script:
      file: pom.xml
      name: spring-boot:run "-Dspring-boot.run.jvmArguments=-Xmx1g -Dacme.mode=dev"
```

A profile that swaps a Maven or Gradle name has to repeat the whole name, options included. To run one module of a multi-module Maven build from the root pom, see [Run Spring Boot and Quarkus](/docs/how-to/projects/spring-boot-and-quarkus/#run-one-module-of-a-multi-module-build).

## Use a plain command for the rest

A command that is not a script in one of these files goes in `run`, written as you would type it, with an expression where it needs the port.

```yaml devlanes
services:
  api:
    run: uv run uvicorn acme.main:app --host 127.0.0.1 --port ${{ self.port }} --reload
```

## If a profile should run another script

A profile, a named choice of services for a start, can swap the script name for the services that use it, such as a start script in place of the dev server. [Share settings and choose which services start](/docs/how-to/projects/templates-and-profiles/) shows it.

## If only you need a different script

Your local file, the `devlanes.local.yaml` that stays out of Git, can change the script name and keep the file. [Keep personal changes out of Git](/docs/how-to/projects/local-overrides/) covers it.

## Related

- [Add devlanes to a project](/docs/how-to/projects/add-devlanes/)
- [Run a service in its runtime](/docs/how-to/projects/runtimes/)
- [Run Vite and Next.js](/docs/how-to/projects/vite-and-next/)
- [Run Spring Boot and Quarkus](/docs/how-to/projects/spring-boot-and-quarkus/)
- [`services.<name>.run_script`](/docs/reference/config/project/services/#services-name-run_script)
