-
-
Notifications
You must be signed in to change notification settings - Fork 812
Closed
Description
Description
When dotenv is configured at the root level of a Taskfile, {{.CLI_ARGS}} is always empty even when arguments are passed after -- on the command line.
Reproduction:
.env (any valid env file):
FOO=bar
Taskfile.yml:
version: '3'
dotenv: ['.env']
tasks:
test:
cmds:
- echo "args={{.CLI_ARGS}}"
Run:
go-task test -- hello world
Expected output:
args=hello world
Actual output:
args=
Notes"
- Removing
dotenvfrom the Taskfile makes{{.CLI_ARGS}}work correctly $CLI_ARGSas a shell variable is also empty — it is not exported to the environment- Tested on go-task version 3.49.0 on Linux
Workaround:
Pass arguments as prefixed environment variables instead:
EMAIL=foo@bar.com go-task mytask
Version
3.49.0
Operating system
Alpine Linux 3.24.0_alpha20260127 with kernel 6.18.2
Experiments Enabled
No response
Example Taskfile
version: '3'
dotenv: ['.env']
tasks:
test:
cmds:
- echo "args={{.CLI_ARGS}}"Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.