Feature Request: Show recipe source files in `--list` output (similar to `git config --show-origin`)
- Dominant language
- Rust
- Stars
- 35.8k
- Forks
- 846
- Avg merge
- 27m
- Merged PRs (30d)
- 3
Description
When working with complex `justfile`s that use `import` statements or modules to compose recipes from multiple files, it can be difficult to determine which file contains a particular recipe.
It would be great to add the ability to show which file each recipe comes from when using `just --list`, similar to how `git config --list --show-origin` prepends each configuration line with its source file:
```bash
$ git config --list --show-origin
file:/home/user/.gitconfig user.name=John Doe
file:.git/config core.repositoryformatversion=0
```
## Proposed Solution
Add a `--show-origin` flag that can be combined with `--list`:
```bash
$ just --list --show-origin
build.just:build Build the project
test.just:test Run tests
justfile:deploy Deploy to production
lint.just:lint Run linter
```
For recipes in modules, show the module path:
```bash
docker/mod.just:docker::build Build Docker image
docker/mod.just:docker::push Push to registry
```
## Related Issues
- #2107 - Improve `--list` output with modules (discusses module display but not source files)
## Workarounds
I'm currently labeling every recipe with a `[group]` attribute matching the source file name to track origins:
```just
# In build.just
[group: 'build.just']
build:
cargo build
# In test.just
[group: 'test.just']
test:
cargo test
```
Contributor guide
Assessment
This issue has not been assessed yet.