Skip to content

list: show fallback recipes when fallback is enabled#3097

Open
veeceey wants to merge 1 commit intocasey:masterfrom
veeceey:feat/issue-1500-list-fallback-recipes
Open

list: show fallback recipes when fallback is enabled#3097
veeceey wants to merge 1 commit intocasey:masterfrom
veeceey:feat/issue-1500-list-fallback-recipes

Conversation

@veeceey
Copy link
Copy Markdown

@veeceey veeceey commented Feb 23, 2026

When set fallback is active, just --list now walks up the directory tree and also displays recipes from parent justfiles. Each parent's recipes appear under a clearly labeled heading:

Available recipes:
    child-recipe # A child recipe

# Fallback recipes from /path/to/parent
Available recipes:
    build         # Another one
    parent-recipe # A parent recipe

It keeps walking as long as each parent also has set fallback enabled, and respects the same search config constraints as the run fallback logic (only works with directory-based search, not --justfile).

Changes:

  • Search now derives Clone so we can iterate parent directories
  • list() takes loader and search parameters to compile parent justfiles
  • Added integration test

Manual test results:

$ cd /tmp/just-test/sub && just --list
Available recipes:
    child-recipe # A child recipe

# Fallback recipes from /private/tmp/just-test
Available recipes:
    build         # Another one
    parent-recipe # A parent recipe

All existing fallback (14) and list (45) tests pass.

Fixes #1500

@veeceey veeceey force-pushed the feat/issue-1500-list-fallback-recipes branch from dc96bd9 to 3a2d42d Compare March 10, 2026 13:08
@veeceey
Copy link
Copy Markdown
Author

veeceey commented Mar 12, 2026

just a gentle nudge on this when you have a moment!

When `set fallback` is active and `just --list` is run, the output now
also includes recipes from parent justfiles, displayed under a
"Fallback recipes from <path>" heading. This walks up the directory
tree, loading each parent justfile until one without fallback is found.

Fixes casey#1500
@veeceey veeceey force-pushed the feat/issue-1500-list-fallback-recipes branch from 3a2d42d to 0bbc51c Compare March 18, 2026 05:17
Copy link
Copy Markdown
Owner

@casey casey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

The fallback logic is complex enough that I don't want to duplicate it. It should be shared between list and run.

Also, not all recipes in parent justfiles are runnable.In particular, if you have a recipe foo in the justfile in the current directory, and a recipe foo in a fallback justfile in the parent directory, the parent foo is not runnable, since just foo will run foo in the current directory, so it should be filtered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"just --list" should list fallback recipes

2 participants