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 hook shims.
The effective hooks directory defaults to .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 configured hooks.
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 configured hooks
<h3 class="cli-reference">Usage</h3>prek run [OPTIONS] [HOOK|PROJECT]...
List configured hooks
<h3 class="cli-reference">Usage</h3>prek list [OPTIONS] [HOOK|PROJECT]...
Uninstall prek Git hook shims
<h3 class="cli-reference">Usage</h3>prek uninstall [OPTIONS]
Validate prek configuration files
<h3 class="cli-reference">Usage</h3>prek validate-config [OPTIONS] [CONFIG]...
Validate pre-commit hook manifests (.pre-commit-hooks.yaml)
prek validate-manifest [OPTIONS] [MANIFEST]...
Generate a sample prek configuration file
<h3 class="cli-reference">Usage</h3>prek sample-config [OPTIONS]
Update configured repositories
<h3 class="cli-reference">Usage</h3>prek 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 hooks from a repository
<h3 class="cli-reference">Usage</h3>prek try-repo [OPTIONS] <REPO> [HOOK|PROJECT]...
Run 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]
Manage the prek installation
<h3 class="cli-reference">Usage</h3>prek self [OPTIONS] <COMMAND>
Update prek
<h3 class="cli-reference">Usage</h3>prek self update [OPTIONS] [TARGET_VERSION]