Skip to content

Add setting to control loading .env from parent folders - #2916

Open
fnando wants to merge 1 commit into
mainfrom
dotenv-parent-resolution
Open

fnando wants to merge 1 commit into
mainfrom
dotenv-parent-resolution

Conversation

@fnando

@fnando fnando commented Dec 5, 2026

Copy link
Copy Markdown
Member

What

Add a settings.dotenv_parent_resolution option to config.toml that controls whether .env files are looked up in parent directories. When it's not set, the CLI keeps today's behavior (walk up from the current directory) and prints a warning on every run explaining that the default will become false in the next major release, with a snippet showing what to add to the config. --quiet suppresses the warning. The CLI never writes this setting itself.

Why

Users who want a tighter setup can set dotenv_parent_resolution = false so that only a .env in the current directory is ever loaded, making it explicit which values feed into a command. The warning nudges everyone else to make that choice before the default changes.

Known limitations

The setting is read before .env is loaded, so a STELLAR_CONFIG_HOME defined in the nearest .env is peeked at to find the right config.toml. A parent .env that sets STELLAR_CONFIG_HOME therefore points at the config that decides whether that same file is loaded.

@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Dec 5, 2026
@fnando
fnando requested review from a team and leighmcculloch December 5, 2026 00:30
@fnando fnando self-assigned this Dec 5, 2026
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

1 participant