Title: docs: `dev --env-file` help/docs say it does not reach tasks, but it does · Issue #4425 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: docs: `dev --env-file` help/docs say it does not reach tasks, but it does · Issue #4425 · triggerdotdev/trigger.dev
X Title: docs: `dev --env-file` help/docs say it does not reach tasks, but it does · Issue #4425 · triggerdotdev/trigger.dev
Description: Provide environment information trigger.dev 4.5.0 (also verified 4.5.9) Describe the bug 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-pre...
Open Graph Description: Provide environment information trigger.dev 4.5.0 (also verified 4.5.9) Describe the bug The --env-file option is documented — in the CLI --help for dev/deploy/preview and in the docs pages (cli-de...
X Description: Provide environment information trigger.dev 4.5.0 (also verified 4.5.9) Describe the bug The --env-file option is documented — in the CLI --help for dev/deploy/preview and in the docs pages (cli-de...
Opengraph URL: https://github.com/triggerdotdev/trigger.dev/issues/4425
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"docs: `dev --env-file` help/docs say it does not reach tasks, but it does","articleBody":"### Provide environment information\n\ntrigger.dev 4.5.0 (also verified 4.5.9)\n\n### Describe the bug\n\nThe `--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:\n\n> Load environment variables from a file. This will only hydrate the `process.env` of the CLI process, **not the tasks**.\n\nBut 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, …)`:\n\n```js\nasync #getEnvVars() {\n const environmentVariablesResponse = await this.options.client.getEnvironmentVariables(...);\n return {\n ...resolveLocalEnvVars(this.options.args.envFile, environmentVariablesResponse.success ? ... : {}),\n NODE_ENV: \"development\",\n ...\n };\n}\n```\n\nand `resolveLocalEnvVars(envFile, …)` → `resolveDotEnvVars(undefined, envFile)` reads exactly that file and includes it in what the task receives via `process.env`.\n\n### To reproduce\n\n1. `echo \"PROBE=from-file\" > custom.env`\n2. `trigger dev --env-file custom.env`\n3. In a task: `process.env.PROBE`\n4. It is `from-file` — the task **does** see the `--env-file` value.\n\nExpected per the docs: the task should NOT see it (docs say the flag only affects the CLI process).\n\n### Which is correct?\n\nThe 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:\n\n- **fix the docs/`--help`** to say `--env-file` values are included in the task environment, or\n- if the documented behavior is the intended contract, fix `dev` to not pass `envFile` into `resolveLocalEnvVars`.\n\nEither way the code and the docs currently disagree, which makes `--env-file` hard to reason about.\n\n### Additional information\n\nRelated: #2999 (the `.env` vs `.env.local` precedence bug in the same `resolveDotEnvVars` path).\n","author":{"url":"https://github.com/petrbela","@type":"Person","name":"petrbela"},"datePublished":"2026-07-30T10:36:28Z","url":"https://github.com/triggerdotdev/trigger.dev/issues/4425"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b903193d-539f-0099-2154-9fc650870689 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B8EE:90D42:34CEF0:4ED9E9:6AFAE233 |
| html-safe-nonce | 109fa6a8e3bf5403b5bbd6d0a8b15f593ce7d1effbe772e99b403f6b57541037 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOEVFOjkwRDQyOjM0Q0VGMDo0RUQ5RTk6NkFGQUUyMzMiLCJ2aXNpdG9yX2lkIjoiMjc4NTIwOTcxMzk4MzkzOTEyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 490a139ca2102f5910a9ad6c82b9010f7ce96077de44d9384e5037ce0225e4d2 |
| hovercard-subject-tag | issue:5018824945 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/triggerdotdev/trigger.dev/4425/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d6e220b6dcc419b6f1dcf1aa77bfc0cbc750bac7cd34a5988efba913998fda4d/triggerdotdev/trigger.dev/issues/4425 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d6e220b6dcc419b6f1dcf1aa77bfc0cbc750bac7cd34a5988efba913998fda4d/triggerdotdev/trigger.dev/issues/4425 |
| og:image:alt | Provide environment information trigger.dev 4.5.0 (also verified 4.5.9) Describe the bug The --env-file option is documented — in the CLI --help for dev/deploy/preview and in the docs pages (cli-de... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | petrbela |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d9bd51a568909a83d1abb9d6f74d68f0c87ca85fe3a56d3f5d70d8b89add9f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git |
| octolytics-dimension-user_id | 95297378 |
| octolytics-dimension-user_login | triggerdotdev |
| octolytics-dimension-repository_id | 572570113 |
| octolytics-dimension-repository_nwo | triggerdotdev/trigger.dev |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 572570113 |
| octolytics-dimension-repository_network_root_nwo | triggerdotdev/trigger.dev |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a7ae932999cc6d511008dbf980ff9efad2a31f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width