Skip to content

Shell Completions

Jake provides tab completion for recipe names and flags in bash, zsh, and fish.

The easiest way to set up completions:

Terminal window
jake --completions --install

This automatically detects your shell and installs completions to the appropriate location.

Generate the completion script and save it:

Terminal window
jake --completions bash > ~/.local/share/bash-completion/completions/jake
Terminal window
jake --completions zsh > ~/.zsh/completions/_jake

You may need to add the completions directory to your fpath in ~/.zshrc:

Terminal window
fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit && compinit
Terminal window
jake --completions fish > ~/.config/fish/completions/jake.fish

The --install command automatically detects your zsh environment:

EnvironmentInstall LocationConfiguration
Oh-My-Zsh~/.oh-my-zsh/custom/completions/_jakeNone needed
Homebrew zsh/opt/homebrew/share/zsh/site-functions/_jakeNone needed
Vanilla zsh~/.zsh/completions/_jakeAuto-patches ~/.zshrc
Bash~/.local/share/bash-completion/completions/jakeNone needed
Fish~/.config/fish/completions/jake.fishNone needed

For vanilla zsh, the installer adds a configuration block to ~/.zshrc:

Terminal window
# >>> jake completion >>>
# This block is managed by jake. Do not edit manually.
fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit && compinit -u
# <<< jake completion <<<

Remove completions and configuration:

Terminal window
jake --completions --uninstall

This removes the completion file and cleans up any .zshrc modifications.

Tab completion works for:

  • Recipe names - Dynamically loaded from your Jakefile
  • CLI flags - All options like --list, --dry-run, --verbose
  • Flag values - File paths for -f/--jakefile, shell names for --completions

After installation, restart your shell (or source your config file):

Terminal window
# Complete recipe names
jake bu<TAB> # → jake build
# Complete flags
jake --<TAB> # Shows all available flags
# Complete flag values
jake --completions <TAB> # → bash, zsh, fish
jake -f <TAB> # → file completion

For scripting and integration with other tools:

Terminal window
# Space-separated list of recipe names
jake --summary
# Output: build test deploy clean lint
# One recipe per line
jake -l --short
# Use in scripts
for recipe in $(jake --summary); do
echo "Found recipe: $recipe"
done
  1. Restart your shell after installation
  2. Verify the completion file exists:
    Terminal window
    ls ~/.zsh/completions/_jake # zsh
    ls ~/.config/fish/completions/jake.fish # fish
  3. For zsh, ensure compinit is called in your config

Completions load recipes from the Jakefile in the current directory. Make sure you’re in the right project directory.

Recipe names are loaded dynamically. If you have a very large Jakefile with many imports, completions might be slightly delayed.