Skip to content

usage complete-word

Generate shell completion candidates for a partial command line

What the scripts from usage generate completion run on every Tab: they pass the words typed so far and read back one candidate per line. Useful by hand, too, for checking what a spec offers at a given point without installing anything.

Arguments

  • [WORDS]… — The words typed so far, starting with the program name

Flags

  • -f --file <FILE> — A usage spec file, or a script with a usage shebang; "-" reads stdin

  • -s --spec <SPEC> — The spec itself, as a string, instead of a file

  • --cword <CWORD> — Index of the word being completed; defaults to the last word

  • --shell <SHELL> — The shell the candidates are for, which decides how they are quoted

    Choices: bash, fish, nu, powershell, zsh

    Default: bash

  • -h --help — Print help

MIT LicenseCopyright © 2026jdx.dev