You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs: dev --env-file help/docs say it does not reach tasks, but it does #4425
The --env-file option is documented — in the CLI --help for dev/deploy/preview and in the docs pages (cli-dev-commands, cli-deploy-commands, cli-preview-archive) — as:
Load environment variables from a file. This will only hydrate the process.env of the CLI process, not the tasks.
But in dev, the file is passed through to the tasks. DevSupervisor.#getEnvVars() (dev/devSupervisor.ts) builds the run environment from resolveLocalEnvVars(this.options.args.envFile, …):
and resolveLocalEnvVars(envFile, …) → resolveDotEnvVars(undefined, envFile) reads exactly that file and includes it in what the task receives via process.env.
To reproduce
echo "PROBE=from-file" > custom.env
trigger dev --env-file custom.env
In a task: process.env.PROBE
It is from-file — the task does see the --env-file value.
Expected per the docs: the task should NOT see it (docs say the flag only affects the CLI process).
Which is correct?
The behavior (file reaches tasks) is arguably the more useful one — passing --env-file /path/to/empty is a clean way to make the CLI read no ambient .env* files and rely solely on the injected process.env. But the docs and --help text state the opposite, so please either:
fix the docs/--help to say --env-file values are included in the task environment, or
if the documented behavior is the intended contract, fix dev to not pass envFile into resolveLocalEnvVars.
Either way the code and the docs currently disagree, which makes --env-file hard to reason about.
Additional information
Related: #2999 (the .env vs .env.local precedence bug in the same resolveDotEnvVars path).
Working on this. DevSupervisor.#getEnvVars() does pass --env-file through via resolveLocalEnvVars, so I'll correct the CLI help string and the three docs pages (cli-dev-commands, cli-deploy-commands, cli-preview-archive) to describe the real per-command behaviour rather than a blanket 'not the tasks'.
Vouch request open at #4845 — holding the PR until vouched.
Withdrawing my comment above — I missed that #4473 (@RealBhupesh) and #4478 (@BILLKISHORE) already did this in August, both touching the same docs/snippets/cli-options-env-file.mdx and packages/cli-v3/src/commands/dev.ts. Both were closed the day they were opened by the vouch gate rather than on their merits, so the work exists and is just blocked.
Nothing needed from me here; the fix has been written twice already.
Activity
Srinivasan8888 commentedon Aug 31, 2026
Working on this.
DevSupervisor.#getEnvVars()does pass--env-filethrough viaresolveLocalEnvVars, so I'll correct the CLI help string and the three docs pages (cli-dev-commands,cli-deploy-commands,cli-preview-archive) to describe the real per-command behaviour rather than a blanket 'not the tasks'.Vouch request open at #4845 — holding the PR until vouched.
Srinivasan8888 commentedon Aug 31, 2026
Withdrawing my comment above — I missed that #4473 (@RealBhupesh) and #4478 (@BILLKISHORE) already did this in August, both touching the same
docs/snippets/cli-options-env-file.mdxandpackages/cli-v3/src/commands/dev.ts. Both were closed the day they were opened by the vouch gate rather than on their merits, so the work exists and is just blocked.Nothing needed from me here; the fix has been written twice already.