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 devYou 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| Mode | Command selection | Trailing arguments |
|---|---|---|
| Single server | tasks.dev.command in lpm.json, then scripts.dev in package.json | Arguments for the command |
| Several services | A nonempty services object in lpm.json | Service names to start, including their dependencies |
Configure lpm.json
Use a task to keep the dev command and its environment together:
{
"tasks": {
"dev": {
"command": "vite",
"env": "development"
}
},
"https": true
}lpm dev
lpm dev --env staging --no-https
lpm dev -- --host 0.0.0.0tasks.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.
| Configuration | Behavior | One-run override |
|---|---|---|
tasks.dev.command | Dev command | Append arguments after -- |
tasks.dev.env | Environment for dev | --env <MODE> |
env.dev | Environment mapping when the task has none | --env <MODE> |
runtime.node, runtime.bun | Managed runtime versions | See lpm use |
https | Local HTTPS frontend | --https, --no-https |
tunnel.domain | Public tunnel with this domain | --domain <NAME>, --no-tunnel |
proxy.host | Local hostname for the primary service | See lpm proxy |
services | Service commands and dependencies | Service names after lpm dev |
See the configuration reference for the complete schema.
Run several services
{
"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 webThe 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 field | Purpose |
|---|---|
command | Required shell command |
cwd | Working directory inside the project, relative to its root |
env | Variables for this service, after the shared project environment |
port | Preferred port. If it is occupied, LPM CLI can assign another port |
primary | Select the service for browser, HTTPS, tunnel, and network features |
dependsOn | Services that must be ready first |
readyPort | Additional TCP readiness check |
readyUrl | Local plain HTTP URL. Readiness requires a successful HTTP response |
readyTimeout | Readiness limit in seconds. Default: 30. Maximum: 3600 |
restart | Restart a crashed service with increasing delays. Default: false |
host | Local 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-installA 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 stagingEnvironment 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:
.env.env.local.env.<MODE>.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-checkDeclaration 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-bootstrapLPM 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
| Problem | Recovery |
|---|---|
| No dev command | Add scripts.dev to package.json or tasks.dev.command to lpm.json |
Missing executable after --no-install | Run lpm install, then start the session again |
| Incompatible Node version | Select a matching runtime with lpm use |
| Schema failure | Correct the reported variable, service override, or schema default |
| Service ignores its port | Make the command read PORT, or use a supported framework entry point |
| Readiness timeout | Check the service logs, readiness URL, and readyTimeout |
| Certificate setup needs consent | Run interactively, use lpm cert trust, or pass --yes |
| Requested inspector port is occupied | Remove --inspect-port to use an available port |
Flags
| Flag | Effect |
|---|---|
--https | Enable the local HTTPS frontend |
--no-https | Disable that frontend for this run |
--tunnel | Enable a public tunnel |
--no-tunnel | Disable the tunnel for this run |
--domain <NAME> | Enable a tunnel with this domain, overriding configuration |
--tunnel-auth | Require a session access token for the tunnel |
--network | Show 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-check | Skip value checks and schema defaults |
--no-install | Skip automatic dependency installation |
--no-open | Keep the browser closed |
--dashboard | Show the service dashboard |
--no-dashboard | Use prefixed service output |
--no-inspect | Disable the tunnel's browser inspector |
--inspect-port <N> | Require this inspector port. Range: 1–65535 |
--quiet, -q | Suppress inline webhook output |
--yes, -y | Approve certificate trust setup and managed hosts-file changes |
--allow-ca-bootstrap | Serve the root CA over HTTP for LAN trust setup |
--dashboard and --no-dashboard cannot be combined.
Inspector options have no effect without a tunnel.