#3523·just

Complete recipe parameters and `arg` flags in Zsh

Author: pygarapCreated Jul 2, 2026Updated Jul 13, 2026

Summary

Please extend the existing Zsh completion support so it can complete recipe-specific parameters, options, and flags from the resolved justfile.

just 1.55.1 already provides Zsh completion scripts via just --completions zsh, and the generated Zsh script delegates to JUST_COMPLETE=zsh just. This request is to make that existing completion path more recipe-aware after a recipe has been selected.

Current behavior

Zsh completion can be installed with:

bash
$ mkdir -p ~/.zsh/completions
$ just --completions zsh > ~/.zsh/completions/_just

And then enabled in .zshrc with:

bash
fpath=(~/.zsh/completions $fpath)
autoload -U compinit
compinit

This provides completion for just itself and available recipes, but it does not complete the selected recipe's own parameters, options, and flags declared with [arg(...)].

Example

just
[arg("target", help="Test target")]
[arg("verbose", long="verbose", value="--verbose", help="Use verbose output")]
test target verbose="":
  cargo test {{verbose}} {{target}}

Expected completion behavior:

bash
$ just <TAB>
test

$ just test --<TAB>
--verbose  Use verbose output

Requested behavior

  • Complete recipes from the resolved justfile, using the same justfile discovery behavior as a normal just invocation.
  • After a recipe is selected, complete only the parameters, options, and flags that belong to that recipe.
  • Complete long options and flags declared with [arg(ARG, long="LONG")].
  • Complete short options and flags declared with [arg(ARG, short="S")].
  • Include help text from [arg(ARG, help="HELP")] in Zsh completion descriptions when available.
  • Support flags declared with [arg(ARG, long="LONG", value=VALUE)] or [arg(ARG, short="S", value=VALUE)].
  • Support options that take values, including repeatable variadic options.
  • Avoid suggesting unrelated recipe names where recipe-specific arguments, options, or flags are expected.

Motivation

This would make Zsh completion more useful for justfiles that expose recipes as small command-line interfaces with documented parameters, options, and flags.