You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using task in larger setups it would be more convenient to pass some of the configuration options via the environment variable so as not to update every line containing task invocation to add or remove options. Consider scenario of having several scripts with contents like:
#!/bin/sh
task target1
#....
task target2
to make them run in dry mode one has to alter all the shell scripts to include --dry option. However with environment variable configuration one can simply:
export TASK_DRY=yes
and run scripts with all task invocations picking up desired option automatically.
Of course --dry is only a sample, control of concurrency between workstation and CI node would be another good example. As well as increasing verbosity while debugging etc.
Hello!
We’ve already added several configuration options to .taskrc, and we don’t plan to support additional ones via environment variables.
If something is missing from .taskrc, feel free to open an issue or submit a PR.
For a lot of use cases, especially automation/CI, the preference is to use environment variables over configuration files. For these use cases, configuration files can be quite unpractical. More often than not, if a configuration file is used, that is only as a basis for operation - it is expected to use the environment to further refine that operation.
For me, the most important piece of this to get is an environment variable that defines the location of the task file. If you need to change the task file that task is reading dynamically from the environment, there is currently no way of doing it.
Activity
jwater7 commentedon Apr 22, 2024
I love this, exactly what I was looking for (specify the taskfile/entrypoint via an env var) - how do we get this in main so we can start using it?
droopy4096 commentedon Apr 24, 2024
someone will have to review and approve #1067
silent: trueon the root of the taskfile. #1455 as a duplicate of this issuevmaerten commentedon Dec 14, 2025
Hello!
We’ve already added several configuration options to
.taskrc, and we don’t plan to support additional ones via environment variables.If something is missing from
.taskrc, feel free to open an issue or submit a PR.trulede commentedon Dec 14, 2025
For a lot of use cases, especially automation/CI, the preference is to use environment variables over configuration files. For these use cases, configuration files can be quite unpractical. More often than not, if a configuration file is used, that is only as a basis for operation - it is expected to use the environment to further refine that operation.
If you take a look at git-sync, there is a good example of how to do this. Nearly every CLI option is mirrored by a environment variable:
https://github.com/kubernetes/git-sync?tab=readme-ov-file#manual
Now, to work around these kinds of issues it not difficult, but the question remains, why can't Task be so easy to operate?
vmaerten commentedon Dec 14, 2025
I understand!
@pd93 / @andreynering should we revisit and add env variables for each CLI / taskrc option ?
jwater7 commentedon Dec 14, 2025
For me, the most important piece of this to get is an environment variable that defines the location of the task file. If you need to change the task file that task is reading dynamically from the environment, there is currently no way of doing it.
For example, if there is a shared build setup:
andreynering commentedon Dec 15, 2025
I'm fine with adding them 👍