Skip to main content
For running included Taskfiles in a different directory, see Include Other Taskfile to Run on Different Directory.
By default, tasks run in the directory where the Taskfile is located. Use the dir keyword to run a task’s commands in a different directory.
Taskfile.yml
version: '3'
tasks:
  get-working-directory:
    dir: ./app1
    cmds:
      - pwd
If the specified directory does not exist, Task will create it automatically.
Demo and output
ubuntu@touted-mite:~$ task get-working-directory
task: [get-working-directory] pwd
/home/ubuntu/app1

Build docs developers (and LLMs) love