Skip to content

Commit 375e910

Browse files
update docs and clarify use
1 parent fa847ec commit 375e910

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

docs/guides/configuration.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,21 @@ The rest of the `.env` file variables can be used in your configuration files wi
123123

124124
#### Custom dot env file location and name
125125

126-
By default, SQLMesh loads `.env` files from each project directory. Alternatively, you can export the `SQLMESH_DOTENV_PATH` environment variable to specify a custom path and persist it across commands:
126+
By default, SQLMesh loads `.env` files from each project directory. However, you can specify a custom path using the `--dotenv` CLI flag directly when running a command:
127+
128+
```bash
129+
sqlmesh --dotenv /path/to/custom/.env plan
130+
```
131+
132+
!!! note
133+
The `--dotenv` flag is a global option and must be placed **before** the subcommand (e.g. `plan`, `run`), not after.
134+
135+
Alternatively, you can export the `SQLMESH_DOTENV_PATH` environment variable once, to persist a custom path across all subsequent commands in your shell session:
127136

128137
```bash
129138
export SQLMESH_DOTENV_PATH=/path/to/custom/.custom_env
130139
sqlmesh plan
140+
sqlmesh run
131141
```
132142

133143
**Important considerations:**

0 commit comments

Comments
 (0)