docs/reference/cli.md
A fast Git hook manager written in Rust, designed as a drop-in alternative to pre-commit, reimagined.
<h3 class="cli-reference">Usage</h3>prek [OPTIONS] [HOOK|PROJECT]... [COMMAND]
Install prek Git shims into Git's effective hooks directory.
By default this is .git/hooks/, but repo-local or worktree-local core.hooksPath is honored when set.
The Git shims installed by this command are determined by --hook-type or default_install_hook_types in the config file, falling back to pre-commit when neither is set.
A hook's stages field does not affect which Git shims this command installs.
prek install [OPTIONS] [HOOK|PROJECT]...
Prepare environments for all hooks used in the config file.
This command does not install Git shims. To install the Git shims along with the hook environments in one command, use prek install --prepare-hooks.
prek prepare-hooks [OPTIONS] [HOOK|PROJECT]...
Run hooks
<h3 class="cli-reference">Usage</h3>prek run [OPTIONS] [HOOK|PROJECT]...
List hooks configured in the current workspace
<h3 class="cli-reference">Usage</h3>prek list [OPTIONS] [HOOK|PROJECT]...
Uninstall prek Git shims
<h3 class="cli-reference">Usage</h3>prek uninstall [OPTIONS]
Validate configuration files (prek.toml or .pre-commit-config.yaml)
<h3 class="cli-reference">Usage</h3>prek validate-config [OPTIONS] [CONFIG]...
Validate .pre-commit-hooks.yaml files
prek validate-manifest [OPTIONS] [MANIFEST]...
Produce a sample configuration file (prek.toml or .pre-commit-config.yaml)
<h3 class="cli-reference">Usage</h3>prek sample-config [OPTIONS]
Auto-update the rev field of repositories in the config file to the latest version
prek auto-update [OPTIONS]
Manage the prek cache
<h3 class="cli-reference">Usage</h3>prek cache [OPTIONS] <COMMAND>
Show the location of the prek cache
<h3 class="cli-reference">Usage</h3>prek cache dir [OPTIONS]
Remove unused cached repositories, hook environments, and other data
<h3 class="cli-reference">Usage</h3>prek cache gc [OPTIONS]
Remove all prek cached data
<h3 class="cli-reference">Usage</h3>prek cache clean [OPTIONS]
Show the size of the prek cache
<h3 class="cli-reference">Usage</h3>prek cache size [OPTIONS]
Try the pre-commit hooks in the current repo
<h3 class="cli-reference">Usage</h3>prek try-repo [OPTIONS] <REPO> [HOOK|PROJECT]...
Utility commands
<h3 class="cli-reference">Usage</h3>prek util [OPTIONS] <COMMAND>
Show file identification tags
<h3 class="cli-reference">Usage</h3>prek util identify [OPTIONS] [PATH]...
List all built-in hooks bundled with prek
<h3 class="cli-reference">Usage</h3>prek util list-builtins [OPTIONS]
Install Git shims in a directory intended for use with git config init.templateDir
prek util init-template-dir [OPTIONS] <DIRECTORY>
Convert a YAML configuration file to prek.toml
<h3 class="cli-reference">Usage</h3>prek util yaml-to-toml [OPTIONS] [CONFIG]
prek self management
prek self [OPTIONS] <COMMAND>
Update prek
<h3 class="cli-reference">Usage</h3>prek self update [OPTIONS] [TARGET_VERSION]