Skip to main content
A Projectfile is a YAML file, not too different from Docker Compose. The file can have any name. A very simple Projectfile looks like this:
The location of ./main is relative to the Projectfile’s directory, but the command can be anything.

Top-level keys

services.<name>

The name is used as service.name in telemetry, and in the UI.

How command is run

There is no shell, but arguments are split the way a shell splits them:
  • Spaces, tabs and newlines separate arguments. Several in a row count as one.
  • "double" and 'single' quotes group words: ./app "hello world" passes one argument, hello world.
  • '' or "" passes an empty argument.
  • A backslash keeps the next character as it is: ./app My\ File. Inside double quotes, it only escapes ", \, $ and `. Inside single quotes nothing is special.
  • Quoted parts join: --name="a b" passes --name=a b.
  • Shell syntax is refused, unless quoted: |, &, ;, <, >, (, ), $ and `. So are $ and ` inside double quotes, because Localdev doesn’t expand variables. The Projectfile doesn’t load, with, for example, line 3: services.api.command: invalid command: "$" is variable or command substitution, and ldev runs commands without a shell: quote it to pass it as it is, or put the command in a script (or run sh -c '…')
  • Not refused, and passed as they are: globs (*.txt) and ~.
  • Need a pipe, &&, a redirect or $VAR? Put it in a script, or sh -c '…': command: sh -c './main --port $PORT > out.log'.
  • A path with a slash is relative to the Projectfile’s directory: ./main, bin/server.
  • A bare name is found through PATH: node app.js, go run ./cmd/api.
  • The working directory is always the Projectfile’s directory, wherever you run ldev from.

What happens when a command can’t run

Localdev keeps going. The other services run, and this one shows as Failed with the reason:

env

  • Values are taken as the text in the file.
  • A nested value is an error: services.a.env.N must be a single value.
  • YAML anchors, aliases and merge keys work when reading. The UI can’t edit an env that uses them.
  • Some variables are refused: see Variables Localdev refuses.

store

  • Each is optional. Must be a whole number from 1 to the maximum.
  • Override order: flag, then environment variable, then Projectfile, then default.
  • Read once at start-up. Changing a size needs an ldev restart.
  • Invalid values and misspelled keys stop start-up:
    • store.logs must be a whole number between 1 and 10000000
    • unknown setting store.log: use logs, metric_points, trace_spans

collector

  • Ports are on localhost, from 1 to 65535, and must differ.
  • Services get OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:<grpc port>.
  • Together with -server and -collector-address, this lets two instances of Localdev run at once (see the CLI reference).

What the Projectfile is checked for

The Projectfile is checked when Localdev starts. Errors include the line number, and Localdev exits with code 1 before running anything. The messages are: Errors are printed as plain text, prefixed with the path given to ldev: ldev: Projectfile: line 2: ….

Keys for YAML anchors

Top-level keys starting with x- are ignored (as in Docker Compose), so they can hold anchors:

Changing the file while Localdev runs

  • Localdev doesn’t watch the file.
  • Service commands and new services need an ldev restart.
  • Discard in the environment editor re-reads the variables from the file. See Change variables while Localdev runs.