#1119·pre-commit

Completions for CLI

Author: lewisacidicCreated Aug 15, 2019Updated Jun 30, 2023
Labelsfeature

Following up on #1118, it would be great to have cross-shell completions for the CLI.

These could be statically autogenerated from the output of --help options.

Would be great to have

  1. cross-shell completions (bash, zsh, fish, powershell)
  2. help introspection where supported i.e.
pre-commit i<TAB>
install  (Install the pre-commit script)  install-hooks  (Install hook environments...)
  1. complete for installed hooks (i.e.
pre-commit run check-<TAB>
check-added-large-files (Prevent giant files from being committed.)
check-ast   (Simply check whether the files parse as valid python.)
check-toml      (This hook checks toml files for parseable syntax.)
  1. a command line option to install the completions (i.e. pre-commit install-completions --shell zsh).