Skip to main content

Reference Recipe In Sub Dir

just

When you have multiple justfiles in a nested directory structure and you want to refer to recipes in a subdirectory, you can use modules instead of changing directory.

Consider

.
├── bar
   ├── ...
   └── justfile
├── ...
└── justfile

To reference a build recipe from the justfile in the subdirectory:

mod bar

build:
    @just bar::build

The following also works (what I used to do), but it's less elegant:

build:
    (cd bar && just build)