Skip to content

Conversation

@tomers
Copy link

@tomers tomers commented Nov 22, 2025

Enhanced the bash completion script with the following improvements:

  • Extract both recipes and aliases from 'just --list' output instead of only using 'just --summary', providing more complete completions
  • Add support for submodule recipe completion when typing 'just '
  • Automatically detect module justfiles in common locations (, /justfile, modules/, modules//justfile)
  • Parse aliases from both [alias: ...] and [aliases: ...] patterns in list output
  • Add fallback to --summary if --list fails for better compatibility
  • Improve recipe name extraction to handle edge cases better

These changes make tab completion more comprehensive and useful for projects using just modules and aliases.

Enhanced the bash completion script with the following improvements:

- Extract both recipes and aliases from 'just --list' output instead of
  only using 'just --summary', providing more complete completions
- Add support for submodule recipe completion when typing 'just <module> <recipe>'
- Automatically detect module justfiles in common locations
  (, /justfile, modules/, modules//justfile)
- Parse aliases from both [alias: ...] and [aliases: ...] patterns in list output
- Add fallback to --summary if --list fails for better compatibility
- Improve recipe name extraction to handle edge cases better

These changes make tab completion more comprehensive and useful for projects
using just modules and aliases.
Update ~/.just.bash completion function to derive subcommands from just --summary
Make recipe completion hierarchical, completing one :: segment at a time
Support arbitrary nesting depth so patterns like j tests api test complete step-by-step instead of tests api::test
@tomers tomers force-pushed the improve-bash-completion branch from e92f9c5 to cdb12ab Compare December 2, 2025 11:38
Refactor the completion function to locate and utilize justfiles in project directories, allowing for more accurate recipe and alias completions. This update improves the hierarchical completion by searching for justfiles based on the current working directory and the provided prefix, while maintaining a fallback to the previous summary method for broader compatibility.
@Spatenheinz
Copy link
Contributor

I tried this change out. Really some nice completion going on

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.

2 participants