diff --git a/docs/configuration.md b/docs/configuration.md index b8da81be35..30f7a31445 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -326,13 +326,12 @@ trusted_config_paths = [ '~/work/my-trusted-projects', ] +env_file = '.env' # load env vars from a dotenv file, see `MISE_ENV_FILE` + [settings.status] show_env = false show_tools = false -[env] -_.file = '.env' - # "_" is a special key for information you'd like to put into mise.toml that mise will never parse [_] foo = "bar" @@ -499,9 +498,8 @@ This is the path which is used as `{{config_root}}` for the global config file. ### `MISE_ENV_FILE` -Deprecated. Use `env._.file` in `mise.toml` or `~/.config/mise/config.toml` instead. - -Set to a filename to read from env from a dotenv file. e.g.: `MISE_ENV_FILE=.env`. +Set to a filename to read env from a dotenv file. e.g.: `MISE_ENV_FILE=.env`. +This searches for and loads all matching files in the current directory and parent directories. Uses [dotenvy](https://crates.io/crates/dotenvy) under the hood. ### `MISE_${PLUGIN}_VERSION` diff --git a/docs/environments/index.md b/docs/environments/index.md index 7b4566eb86..97144e4ef3 100644 --- a/docs/environments/index.md +++ b/docs/environments/index.md @@ -361,8 +361,10 @@ _.file = [ ] ``` -The legacy [`MISE_ENV_FILE=.env`](/configuration#mise-env-file) setting can also load dotenv -files automatically, but it is deprecated. Use `env._.file` in a config file instead. +To automatically load dotenv files from the current directory and parent directories, set +[`MISE_ENV_FILE=.env`](/configuration#mise-env-file) or `env_file = ".env"` under `[settings]` +in `~/.config/mise/config.toml`. This is different from `env._.file`, which resolves paths +relative to the config file that declares it. See [secrets](/environments/secrets/) for ways to read encrypted files with `env._.file`. diff --git a/schema/mise.json b/schema/mise.json index 7408260bd0..cd54f61d28 100644 --- a/schema/mise.json +++ b/schema/mise.json @@ -704,8 +704,7 @@ }, "env_file": { "description": "Path to a file containing environment variables to automatically load.", - "type": "string", - "deprecated": true + "type": "string" }, "env_shell_expand": { "description": "Enable shell-style variable expansion in env values (e.g., $FOO, ${BAR:-default})", diff --git a/settings.toml b/settings.toml index b673987d0f..b48bfcf442 100644 --- a/settings.toml +++ b/settings.toml @@ -519,9 +519,6 @@ env = "MISE_ENV_CACHE_TTL" type = "Duration" [env_file] -deprecated = "Use env._.file instead." -deprecated_remove_at = "2027.11.0" -deprecated_warn_at = "2026.11.0" description = "Path to a file containing environment variables to automatically load." env = "MISE_ENV_FILE" optional = true @@ -1733,7 +1730,7 @@ env = "MISE_PRERELEASES" type = "Bool" [profile] -deprecated = "Use env._.file instead." +deprecated = "Use MISE_ENV instead." description = "Profile to use for mise.${MISE_PROFILE}.toml files." env = "MISE_PROFILE" hide = true