casey / casey/just

Feature Request: Show recipe source files in `--list` output (similar to `git config --show-origin`)

Open
#2,873 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.