LPM CLI

lpm dev

Run a development server or several services with environments, local HTTPS, and public tunnels.

Start your development environment with one command. LPM CLI prepares dependencies and runtimes, loads project variables, and manages service startup and shutdown.

lpm dev [OPTIONS] [ARGS]...

Quickstart

In a project with a dev script in package.json:

lpm dev

You can start it from the project root or any subdirectory. LPM CLI uses the nearest directory at or above the current one that has a package.json or an lpm.json, stopping before your home directory. It prints that directory when it is not the current one. It refuses a directory whose .lpm would be the LPM home.

LPM CLI runs the script and opens its verified local URL. To keep the browser closed:

lpm dev --no-open
ModeCommand selectionTrailing arguments
Single servertasks.dev.command in lpm.json, then scripts.dev in package.jsonArguments for the command
Several servicesA nonempty services object in lpm.jsonService names to start, including their dependencies

Configure lpm.json

Use a task to keep the dev command and its environment together:

lpm.json
{
  "tasks": {
    "dev": {
      "command": "vite",
      "env": "development"
    }
  },
  "https": true
}
lpm dev
lpm dev --env staging --no-https
lpm dev -- --host 0.0.0.0

tasks.dev.command overrides the package script. tasks.dev.env selects the environment unless you pass --env. An explicit task command does not run package predev or postdev hooks. Without an explicit task command, the package script runs with its hooks.

Direct dev sessions use the task's command and env fields. Task dependencies and caches belong to lpm run.

ConfigurationBehaviorOne-run override
tasks.dev.commandDev commandAppend arguments after --
tasks.dev.envEnvironment for dev--env <MODE>
env.devEnvironment mapping when the task has none--env <MODE>
runtime.node, runtime.bunManaged runtime versionsSee lpm use
httpsLocal HTTPS frontend--https, --no-https
tunnel.domainPublic tunnel with this domain--domain <NAME>, --no-tunnel
proxy.hostLocal hostname for the primary serviceSee lpm proxy
servicesService commands and dependenciesService names after lpm dev

See the configuration reference for the complete schema.

Run several services

lpm.json
{
  "services": {
    "api": {
      "command": "node api.mjs",
      "port": 4000,
      "readyUrl": "http://localhost:4000/health"
    },
    "web": {
      "command": "vite",
      "port": 5173,
      "primary": true,
      "dependsOn": ["api"]
    }
  }
}
lpm dev
lpm dev web
lpm dev --dashboard web

The web service starts after api is ready. Selecting web also selects api through dependsOn. In this mode, trailing arguments select services. They do not become arguments for each command.

A sole service is selected for primary features automatically. Generic workers stay portless unless endpoint configuration requires a listener.

For a generic server that reads PORT, set primary: true or port. Recognized sole development-server commands receive a managed port automatically. With several services, mark one as primary. Port overrides, HTTPS, LAN URLs, tunnels, and the root proxy hostname use this service. When these features need the primary, selecting services that exclude it causes an error.

Each service receives the URLs and ports of other services with assigned ports. For example, web receives API_URL and API_PORT. Services with a managed port also receive PORT.

Service fieldPurpose
commandRequired shell command
cwdWorking directory inside the project, relative to its root
envVariables for this service, after the shared project environment
portPreferred port. If it is occupied, LPM CLI can assign another port
primarySelect the service for browser, HTTPS, tunnel, and network features
dependsOnServices that must be ready first
readyPortAdditional TCP readiness check
readyUrlLocal plain HTTP URL. Readiness requires a successful HTTP response
readyTimeoutReadiness limit in seconds. Default: 30. Maximum: 3600
restartRestart a crashed service with increasing delays. Default: false
hostLocal hostname for this service through the HTTPS proxy

readyUrl accepts local loopback hosts, such as localhost and 127.0.0.1. If both readiness fields are present, readyUrl takes precedence. A readiness failure stops startup and cleans up the service processes.

The service working directory selects its runtime configuration. It does not load a separate set of service dotenv files. A service's Node or Bun selection replaces the same root selection. The service inherits the other runtime.

Use --dashboard for service log panels and webhook inspection. Use --no-dashboard for prefixed text output. The dashboard is a CLI option, without a matching configuration field. Dashboard logs share a total 16 MiB budget across services. Individual log lines have a 64 KiB limit.

Dependencies and runtimes

LPM CLI checks the dependency state before startup. It installs stale dependencies and prepares compatibility for supported framework entry points. This uses the project's registry configuration. The CLI works with npm, private registries, and LPM.dev Registry.

lpm dev --no-install

--no-install skips dependency installation. Runtime preparation still applies. Use LPM_NO_AUTO_INSTALL=1 to prevent automatic runtime downloads:

LPM_NO_AUTO_INSTALL=1 lpm dev --no-install

A missing managed runtime can fall back to the runtime on PATH. By default, the selected Node version must satisfy the applicable engines.node requirements. If engineStrict is disabled in the project configuration, a mismatch produces a warning. See lpm use for version selection and recovery.

Environments and secrets

lpm dev --env staging

Environment selection uses --env, then tasks.dev.env, then env.dev, then the default environment. Named environments can define an inheritance chain. Otherwise, standard loading uses this order:

  1. .env
  2. .env.local
  3. .env.<MODE>
  4. .env.<MODE>.local

Later files override earlier files. Safe inherited variables take precedence over file values. Locally stored secrets from lpm env override matching file values. Restart the session after you change a variable or secret.

If .env does not exist, LPM CLI copies a regular .env.example file to .env once. The copy does not export stored secrets. An existing .env remains unchanged. Before it writes the copy, LPM CLI keeps .env out of Git. If Git does not already ignore it, LPM CLI adds /.env to the project's .gitignore. If it cannot add the rule, it warns and still creates the file. Add the rule yourself before you commit. If Git tracks .env, LPM CLI doesn't create it: it warns with the git rm --cached command that stops the tracking and starts the project without the copy. The new .env is readable and writable only by you.

LPM CLI removes inherited credentials and runtime injection variables before it starts project commands. Explicit project secrets remain available. Project files and service variables cannot override protected runtime or shell variables.

LPM CLI checks envSchema against each command's effective environment. Service variables apply before this check. On Windows, variable names are case-insensitive. A service's env object or envSchema.vars cannot contain two names that differ only by case. Use --no-env-check to skip value checks and schema defaults for one run:

lpm dev --env staging --no-env-check

Declaration errors in lpm.json always stop the command.

Local HTTPS and LAN access

lpm dev --https
lpm dev --https --port 4000
lpm dev --https --network --allow-ca-bootstrap

LPM CLI serves HTTPS through a local frontend and forwards HTTP and WebSocket traffic to the application. The application stays on HTTP. With --https --port 4000, port 4000 belongs to the HTTPS frontend. The application receives a separate internal port. Without an explicit frontend port, the operating system selects one.

On first use, LPM CLI asks before it installs the local CA into the system trust store. Use --yes to approve this step without a prompt. --allow-ca-bootstrap serves the root certificate over plain HTTP on an assigned LAN port for mobile trust setup.

--network shows LAN URLs and a QR code. The application must accept connections through the relevant network interface. --host sets the HTTPS hostname. It does not create public DNS records. See local HTTPS for certificate and mobile setup.

Without HTTPS, --port selects the application port. Supported frameworks receive native port arguments. Other commands receive PORT. LPM CLI checks that the application owns the listener and uses the requested port before it advertises the URL. A single dev command has 30 seconds to open its listener. When the session needs the listener, for HTTPS, --network, a tunnel, or proxy.host, LPM CLI stops a command that opens none in time. Otherwise it keeps running without a URL, so a command that never listens, such as tsc --watch, works too. Services get no terminal input. They run outside the terminal's foreground process group, where a command that read keys from the terminal would be stopped.

Local hostnames

Use proxy.host or services.<name>.host for names such as app.localhost or api.test. If the local HTTPS proxy is stopped, LPM CLI starts it. Then LPM CLI registers routes to the final service ports.

Names outside localhost and *.localhost can need hosts-file changes. LPM CLI asks for consent before it changes the hosts file. When the session exits, LPM CLI removes its project entries. After an interrupted session, use lpm hosts clean to remove orphaned entries.

--no-https disables the session frontend. Configured proxy hostnames still require their own HTTPS proxy and certificate setup. See lpm proxy for proxy listener configuration.

Public tunnels

Tunnels need a Pro plan or one of your organization's claimed domains. See Plans and limits.

lpm dev --tunnel
lpm dev --domain my-api.lpm.llc
lpm dev --tunnel --no-inspect
lpm dev --no-tunnel

--domain enables the tunnel as well as selecting its domain. Even with a domain in lpm.json, --no-tunnel disables the tunnel. A tunnel connects to the verified application endpoint.

The browser inspector starts on an available local port. Use --inspect-port <N> to require a specific port, or --no-inspect to disable the browser server. Request capture continues to .lpm/inspector.db, with raw request and response headers and bodies. .lpm/.gitignore keeps the database out of Git. Use lpm tunnel inspect to read this history.

--tunnel-auth requires a per-session access token for the public URL. --quiet suppresses inline webhook output while capture continues. A permanent tunnel failure stops the dev session, including its local services. See tunneling for authentication, domains, and account limits.

Non-interactive use

lpm dev --https --yes --no-open --no-dashboard

--yes approves certificate trust setup and managed hosts-file changes. Without a terminal and without --yes, a session that needs either stops with confirmation_required instead of trusting the certificate authority or editing the hosts file. Operating-system elevation can still require a prompt. The flag does not sign in to LPM.dev Registry or select a tunnel plan. When CI, CONTINUOUS_INTEGRATION, or GITHUB_ACTIONS is present, the browser also stays closed. If the BROWSER environment variable is set, LPM CLI opens the URL with the command that it names. For example, BROWSER=false keeps the browser closed. Login gives the full BROWSER format.

Stop the session with Ctrl+C. LPM CLI stops the tracked child processes and removes session routes and hosts-file entries.

Troubleshooting

ProblemRecovery
No dev commandAdd scripts.dev to package.json or tasks.dev.command to lpm.json
Missing executable after --no-installRun lpm install, then start the session again
Incompatible Node versionSelect a matching runtime with lpm use
Schema failureCorrect the reported variable, service override, or schema default
Service ignores its portMake the command read PORT, or use a supported framework entry point
Readiness timeoutCheck the service logs, readiness URL, and readyTimeout
Certificate setup needs consentRun interactively, use lpm cert trust, or pass --yes
Requested inspector port is occupiedRemove --inspect-port to use an available port

Flags

FlagEffect
--httpsEnable the local HTTPS frontend
--no-httpsDisable that frontend for this run
--tunnelEnable a public tunnel
--no-tunnelDisable the tunnel for this run
--domain <NAME>Enable a tunnel with this domain, overriding configuration
--tunnel-authRequire a session access token for the tunnel
--networkShow LAN URLs and a QR code
--port <N>Set the application port, or the frontend port with HTTPS. Range: 1–65535
--host <NAME>Set the HTTPS certificate hostname
--env <MODE>Select the environment
--no-env-checkSkip value checks and schema defaults
--no-installSkip automatic dependency installation
--no-openKeep the browser closed
--dashboardShow the service dashboard
--no-dashboardUse prefixed service output
--no-inspectDisable the tunnel's browser inspector
--inspect-port <N>Require this inspector port. Range: 1–65535
--quiet, -qSuppress inline webhook output
--yes, -yApprove certificate trust setup and managed hosts-file changes
--allow-ca-bootstrapServe the root CA over HTTP for LAN trust setup

--dashboard and --no-dashboard cannot be combined. Inspector options have no effect without a tunnel.

See also

  • lpm run — task dependencies, workspace execution, and caches
  • lpm env — project variables and local secrets
  • lpm use — managed runtime versions
  • Local HTTPS — certificates and mobile trust
  • lpm proxy — local hostnames and routes
  • Tunneling — public access and webhook inspection