From 7206042c1cdd1ecc738143221043533ef740c12f Mon Sep 17 00:00:00 2001 From: Mohamed Ajab Date: Sun, 22 Nov 2026 16:53:15 +0000 Subject: [PATCH] docs: show how to choose a dotenv file in the CLI Signed-off-by: Mohamed Ajab --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 3400e67c..f2958611 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,14 @@ $ dotenv list --format=json $ dotenv run -- python foo.py ``` +By default, the CLI reads `.env` from the current working directory. It does +not search parent directories. Use `--file` before the subcommand to choose +another file: + +```shell +$ dotenv --file .env.development run -- python foo.py +``` + Run `dotenv --help` for more information about the options and subcommands. ## File format