task_config.dir = "{{cwd}}" only works for inline TOML tasks, not included TOML tasks or file tasks
#8673
Unanswered
kdheepak
asked this question in
Troubleshooting and bug reports
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Thanks for developing and maintaining mise. It is my favorite workflow tool and I've been using it a lot.
I have a discussion report or a potential bug - I'm seeing inconsistent behavior around
task_config.dir = "{{cwd}}".Based on the docs, I expected a top-level
[task_config]to apply to:task_config.includesBut
task_config.dir = "{{cwd}}"only works for inline TOML tasks, not included TOML tasks or file tasksMy use case is that I have a number of shell scripts that are in my global mise configuration, e.g.
And in my
~/.config/mise/config.tomlconfig file I have the following lines:In my task config file, i.e.
~/.config/mise/tasks/mise.toml, I have some additional tasks that are single line scripts, e.g.This all works great, however, it doesn't run the task in the current
cwd.It seems to be running it from the root directory. I had a nasty surprise when I ran
mise run files:archiveand it began to archive my entire$HOMEfolder 😱 but fortunately I was able to stop it early.My current workaround is to explicitly add cwd to all my task config tasks and the file tasks using the metadata syntax, e.g.:
which seems to work fine but is a little unnecessarily verbose?
The task configuration docs say that top-level
[task_config]applies to "all tasks which are included by that config file or use the same root directory", so I assumed that I would be able to add the following to my global configuration.And as mentioned above, in that case it works for tasks that are described in the same toml file, but does not work for a separate task file or script tasks.
Let me know if I'm mistaken in the understanding that the docs in https://mise.jdx.dev/tasks/task-configuration.html#task-config-dir imply this should work; if yes, this would be a bug report. If no, this is a discussion or a feature request.
Also, this may be related or unrelated but
mise tasks ls --jsonreportsdir: nullfor inheritedtask_config.direven in the inline TOML case where runtime behavior works as expected. I'm not sure if that's just a reporting issue or if it is related to this behavior in this report.Here's every combination that I've tried with
mise 2026.3.9 macos-arm64 (2026-03-13)summarized as a table:dirsourcemise tasks ls --jsondir.config/mise/config.toml[task_config] dir = "{{cwd}}"null.config/mise/config.tomlincludes = ["tasks.toml"][task_config] dir = "{{cwd}}"nulltasks.tomlfile[task_config] dir = "{{cwd}}"inside included filenull.config/mise/config.toml.config/mise/tasks/[task_config] dir = "{{cwd}}"nulldir = "{{cwd}}"#MISE dir="{{cwd}}"or# [MISE] dir="{{cwd}}"Question
Is this intended? If not, I think there are two bugs here:
task_config.diris not being applied to included TOML tasks and file tasksmise tasks ls --jsondoes not surface inheriteddireven when runtime behavior does honor it for some casesIf this is intended, can this behavior be changed?
Beta Was this translation helpful? Give feedback.
All reactions