pre-commit - Man Page

pre-commit – framework for managing and maintaining multi-language pre-commit hooks

Examples (TL;DR)

Synopsis

pre-commit [-h] [-V] {autoupdate,clean,gc,init-templatedir,install,install-hooks,migrate-config,run,sample-config,try-repo,uninstall,validate-config,validate-manifest,help,hook-impl} ...

Options

Positional Arguments

{autoupdate,clean,gc,init-templatedir,install,install-hooks,migrate-config,run,sample-config,try-repo,uninstall,validate-config,validate-manifest,help,hook-impl}
autoupdate

Auto-update pre-commit config to the latest repos’ versions.

See pre-commit-autoupdate(1).

clean

Clean out pre-commit files.

See pre-commit-clean(1).

gc

Clean unused cached repos.

See pre-commit-gc(1).

init-templatedir

Install hook script in a directory intended for use with git config init.templateDir.

See pre-commit-init-templatedir(1).

install

Install the pre-commit script.

See pre-commit-install(1).

install-hooks

Install hook environments for all environments in the config file. You may find pre-commit install --install-hooks more useful.

See pre-commit-install-hooks(1).

migrate-config

Migrate list configuration to new map configuration.

See pre-commit-migrate-config(1).

run

Run hooks.

See pre-commit-run(1).

sample-config

Produce a sample .pre-commit-config.yaml file.

See pre-commit-sample-config(1).

try-repo

Try the hooks in a repository, useful for developing new hooks.

See pre-commit-try-repo(1).

uninstall

Uninstall the pre-commit script.

See pre-commit-uninstall(1).

validate-config

Validate .pre-commit-config.yaml files.

See pre-commit-validate-config(1).

validate-manifest

Validate .pre-commit-hooks.yaml files.

See pre-commit-validate-manifest(1).

help

Show help for a specific command.

See pre-commit-help(1).

Optional Arguments

-h--help

Show a help message and exit.

-V--version

Show program’s version number and exit.

See Also

pre-commit-autoupdate(1), pre-commit-clean(1), pre-commit-gc(1), pre-commit-init-templatedir(1), pre-commit-install(1), pre-commit-install-hooks(1), pre-commit-migrate-config(1), pre-commit-run(1), pre-commit-sample-config(1), pre-commit-try-repo(1), pre-commit-uninstall(1), pre-commit-validate-config(1), pre-commit-validate-manifest(1), pre-commit-help(1)

Referenced By

pre-commit-autoupdate(1), pre-commit-clean(1), pre-commit-gc(1), pre-commit-help(1), pre-commit-init-templatedir(1), pre-commit-install(1), pre-commit-install-hooks(1), pre-commit-migrate-config(1), pre-commit-run(1), pre-commit-sample-config(1), pre-commit-try-repo(1), pre-commit-uninstall(1), pre-commit-validate-config(1), pre-commit-validate-manifest(1).

February 2025