Zero-config dev server
Start a project, then add shared runtime configuration, environments, HTTPS, and services.
Use lpm dev to start your project's development command. Add lpm.json as the project needs shared configuration.
lpm devWith a dev script in package.json, this starts the server and opens its verified local URL. Stop the session with Ctrl+C.
From a subdirectory, lpm dev starts the nearest project, the closest directory with a package.json or an lpm.json, and prints which directory it chose.
{
"scripts": {
"dev": "vite"
}
}Use your project's existing server command. LPM CLI prepares stale dependencies through the configured registries before startup.
Keep the command in lpm.json
An explicit task command takes precedence over scripts.dev:
{
"tasks": {
"dev": {
"command": "vite",
"env": "development"
}
}
}lpm dev --no-open
lpm dev --env staging--env overrides tasks.dev.env, then the env.dev mapping. Without an explicit task command, the package script runs with its predev and postdev hooks.
Direct dev sessions use the task command and environment. Task dependencies and caches run through lpm run.
Pin the runtime
lpm use node@22lpm use installs the selected version and writes the resolved version to lpm.json. Commit that configuration for the team. See Files LPM CLI creates for what to commit and what stays local.
Node selection uses runtime.node, then .nvmrc, then .node-version, then PATH. engines.node checks compatibility but does not select Node.
For a prepared environment that must avoid automatic downloads:
LPM_NO_AUTO_INSTALL=1 lpm dev --no-install --no-open--no-install skips dependencies. The environment variable controls automatic runtime downloads. Install the required runtime and dependencies before this command.
Load variables and local secrets
For the selected development environment, ordinary file loading uses this order:
.env.env.local.env.development.env.development.local
Later files override earlier files. Safe inherited variables take precedence over files. Local secrets from lpm env override matching file values.
If .env does not exist, lpm dev creates it once from .env.example and adds /.env to .gitignore when Git does not already ignore it.
Named environments can specify different files and inheritance. See managing secrets for encrypted storage and team sync.
Add an environment schema to catch missing values before startup:
{
"envSchema": {
"vars": {
"DATABASE_URL": { "required": true, "format": "url" },
"API_KEY": { "required": true, "secret": true }
}
}
}secret: true marks a value as sensitive. It does not move a dotenv value into encrypted storage.
Restart the session after changes to variables. For one diagnostic run, --no-env-check skips value checks and schema defaults. Invalid schema declarations still stop the command.
Add local HTTPS
lpm dev --httpsOn first use, LPM CLI asks before trusting its local certificate authority. Each developer completes that step on their machine.
To enable HTTPS for future sessions, add "https": true to lpm.json:
{
"https": true
}lpm dev --https --port 4000
lpm dev --no-httpsWith HTTPS, port 4000 belongs to the HTTPS frontend. The application runs on a separate internal HTTP port.
Use the URL printed by the command. See local HTTPS for browser trust and mobile setup.
Start several services
Replace the single command with a services object:
{
"services": {
"api": {
"command": "node api.mjs",
"port": 4000,
"readyUrl": "http://localhost:4000/health",
"readyTimeout": 60
},
"web": {
"command": "vite",
"port": 5173,
"primary": true,
"dependsOn": ["api"]
}
}
}The API must read PORT and provide a successful response at /health. LPM CLI can assign another port if the preferred port is occupied.
lpm dev web
lpm dev --dashboardSelecting web also starts api. In service mode, trailing arguments select services instead of becoming command arguments.
The primary service receives browser, HTTPS, tunnel, and LAN features. When you use those features, keep the primary service selected.
The web process receives API_URL and API_PORT. Use these values instead of assuming that the API keeps its preferred port.
An assigned port must belong to the service process. readyPort adds a TCP check. readyUrl adds a local HTTP check and takes precedence.
Readiness failures stop startup and clean up the services. For background workers, omit the port and readiness fields unless they expose an endpoint.
Share a public URL
With a Pro plan, after authentication:
lpm dev --tunnelFor a domain you claim with your Pro plan:
lpm tunnel claim my-api.lpm.llc
lpm dev --domain my-api.lpm.llcFor an organization's domain, an owner or administrator claims it with --org. Any member can then use it:
lpm tunnel claim acme-api.lpm.llc --org acme
lpm dev --domain acme-api.lpm.llcTo enable that domain from configuration:
{
"tunnel": { "domain": "acme-api.lpm.llc" }
}lpm dev --no-tunnelA shared configuration does not grant domain ownership or account access. Each session needs an authorized account.
Tunnel requests enter .lpm/inspector.db with their raw headers and bodies. The project's .lpm/ directory keeps itself out of Git, so the captures are not committed. Use lpm tunnel to inspect and replay captured requests.
lpm tunnel inspect
lpm tunnel replay 3--no-inspect disables the browser inspector, while request capture continues. See tunneling for access controls and account limits.
Run without prompts
lpm dev --https --yes --no-open --no-dashboard--yes approves certificate trust and managed hosts-file changes. Operating-system elevation can still require interaction.
For finite CI jobs, use lpm run, lpm test, or your build command. A dev server stays active until stopped.
Troubleshooting
| Problem | Action |
|---|---|
| No dev command | Add scripts.dev or tasks.dev.command. |
| Missing executable | Run lpm install and check the project command. |
| Runtime mismatch | Select a compatible version with lpm use. |
| Service never becomes ready | Check its logs, PORT handling, and readiness endpoint. |
| Wrong environment value | Check the selected environment, inherited variables, and local secrets. |
| Tunnel access fails | Check the account, reserved domain, and plan through lpm tunnel. |
See also
- lpm dev — command reference
- lpm.json — complete configuration
- Task runner — finite tasks and caches
- Port management — service ports and cleanup