yarn dev:ephemeral
yarn dev:ephemeral starts Open Saasframe development mode on a free local port with a dedicated ephemeral PostgreSQL container, prints the runtime URLs, and opens the same splash status screen used by the regular dev flow so startup progress stays visible until the app is reachable.
The command performs these steps automatically:
- Validates Node.js
24.x(fails early with fix instructions when incompatible). - Creates
apps/saasframe/.envfromapps/saasframe/.env.exampleonly when missing. - Runs
yarn install. - Runs
yarn build:packagesto ensure CLI generators are up to date. - Runs
yarn generateto prepare.saasframe/generatedfiles. - Starts a disposable PostgreSQL container and resolves a unique
DATABASE_URL. - Runs
yarn initialize -- --reinstallagainst that ephemeral database. - Selects a random free app port in the
5000-65535range. - Starts the app runtime with
PORT=<selected-port>and ephemeralDATABASE_URL, forwarding status into the splash screen. - Waits for readiness and records the running instance in
.ai/dev-ephemeral-envs.json.
Usage
yarn dev:ephemeral
Runtime Output
When setup finishes, the command prints:
Ephemeral URL: http://127.0.0.1:<port>Backend URL: http://127.0.0.1:<port>/backendEphemeral PostgreSQL URL: postgresql://...@127.0.0.1:<port>/<db>Opened browser at http://127.0.0.1:<port>/backend
Use that URL for browser testing or MCP tooling.
If auto-open is enabled, the browser opens the local splash status page first. Once runtime warmup finishes, use the ready actions there or navigate directly to the printed backend URL.
Dev Instance Registry
yarn dev:ephemeral writes active instances to .ai/dev-ephemeral-envs.json.
- Every launch validates existing entries and removes stale/non-responsive instances.
- New instances are added with pid, app port, base URL, backend URL, PostgreSQL container ID, DB port, DB URL, worktree cwd, and timestamp.
- Entries are removed automatically when the related dev process exits.
Parallel Instances
Run the command from multiple worktrees to keep isolated app processes on different ports:
# In worktree A
yarn dev:ephemeral
# In worktree B
yarn dev:ephemeral
Each process auto-selects its own free port.
Optional Environment
| Variable | Description |
|---|---|
DEV_EPHEMERAL_PREFERRED_PORT | Optional fixed port override. Must be in 5000-65535; otherwise it is ignored and a random free port is used. |
DEV_EPHEMERAL_POSTGRES_IMAGE | Optional Docker image for ephemeral PostgreSQL. Default: postgres:16. |
DEV_EPHEMERAL_POSTGRES_USER | Optional PostgreSQL user for ephemeral DB. Default: postgres. |
DEV_EPHEMERAL_POSTGRES_PASSWORD | Optional PostgreSQL password for ephemeral DB. Default: postgres. |
Verbose Mode
yarn dev:ephemeral:verbose
This keeps the app runtime in raw passthrough mode while still using the splash screen for the ephemeral setup stages.
Classic Mode
yarn dev:ephemeral:classic
This disables the splash screen entirely and keeps the full ephemeral startup flow in raw passthrough mode for backward-compatible terminal output.