Skip to content

Make dotenv run forward flags to given command#607

Merged
theskumar merged 1 commit intotheskumar:mainfrom
bbc2:run-forward-flags
Jan 12, 2026
Merged

Make dotenv run forward flags to given command#607
theskumar merged 1 commit intotheskumar:mainfrom
bbc2:run-forward-flags

Conversation

@bbc2
Copy link
Copy Markdown
Collaborator

@bbc2 bbc2 commented Jan 11, 2026

Changes for users:

  • (BREAKING) Forward flags passed after dotenv run to the given command instead of interpreting them.
    • This means that an invocation such as dotenv run ls --help will show the help page of ls instead of that of dotenv run.
    • To pass flags to dotenv run itself, pass them right after run: dotenv run --help or dotenv run --override ls.
    • As usual, generic options should be passed right after dotenv: dotenv --file path/to/env run ls

This supersedes #592 which only fixes this problem for commands with one component.

Changes for users:

- (BREAKING) Forward flags passed after `dotenv run` to the given
  command instead of interpreting them.
    - This means that an invocation such as `dotenv run ls --help` will
      show the help page of `ls` instead of that of `dotenv run`.
    - To pass flags to `dotenv run` itself, pass them right after `run`:
      `dotenv run --help` or `dotenv run --override ls`.
    - As usual, generic options should be passed right after `dotenv`:
      `dotenv --file path/to/env run ls`
@theskumar
Copy link
Copy Markdown
Owner

Although this is a breaking change, it feels like the right thing to do. It also feels intuitive enough to move forward with. I'll merge this in. Thank you @bbc2 !

@theskumar theskumar merged commit 9f3b8b5 into theskumar:main Jan 12, 2026
8 checks passed
@bbc2 bbc2 deleted the run-forward-flags branch January 17, 2026 11:53
@oppoma75-code

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants