# CLI Reference ## prek Better pre-commit, re-engineered in Rust
prek installInstall prek Git shims under the .git/hooks/ directory
prek prepare-hooksPrepare environments for all hooks used in the config file
prek runRun hooks
prek listList hooks configured in the current workspace
prek uninstallUninstall prek Git shims
prek validate-configValidate configuration files (prek.toml or .pre-commit-config.yaml)
prek validate-manifestValidate .pre-commit-hooks.yaml files
prek sample-configProduce a sample configuration file (prek.toml or .pre-commit-config.yaml)
prek auto-updateAuto-update the rev field of repositories in the config file to the latest version
prek cacheManage the prek cache
prek try-repoTry the pre-commit hooks in the current repo
prek utilUtility commands
prek selfprek self management
HOOK|PROJECTInclude the specified hooks or projects.
Supports flexible selector syntax:
hook-id: Run all hooks with the specified ID across all projects
project-path/: Run all hooks from the specified project
project-path:hook-id: Run only the specified hook from the specified project
Can be specified multiple times to select multiple hooks/projects.
--allow-missing-configAllow a missing configuration file
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--git-dir git-dirInstall Git shims into the hooks subdirectory of the given git directory (<GIT_DIR>/hooks/).
When this flag is used, prek install bypasses the safety check that normally refuses to install shims while core.hooksPath is set. Git itself will still ignore .git/hooks while core.hooksPath is configured, so ensure your Git configuration points to the directory where the shim is installed if you want it to be executed.
--help, -hDisplay the concise help for this command
--hook-type, -t hook-typeWhich Git shim(s) to install.
Specifies which Git hook type(s) you want to install shims for. Can be specified multiple times to install shims for multiple hook types.
If not specified, uses default_install_hook_types from the config file, or defaults to pre-commit if that is also not set.
Note: This is different from a hook's stages parameter in the config file, which declares which stages a hook can run in.
Possible values:
commit-msgpost-checkoutpost-commitpost-mergepost-rewritepre-commitpre-merge-commitpre-pushpre-rebaseprepare-commit-msg--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--overwrite, -fOverwrite existing Git shims
--prepare-hooks, --install-hooksAlso prepare environments for all hooks used in the config file
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--skip hook|projectSkip the specified hooks or projects.
Supports flexible selector syntax:
hook-id: Skip all hooks with the specified ID across all projects
project-path/: Skip all hooks from the specified project
project-path:hook-id: Skip only the specified hook from the specified project
Can be specified multiple times. Also accepts PREK_SKIP or SKIP environment variables (comma-delimited).
--verbose, -vUse verbose output
--version, -VDisplay the prek version
HOOK|PROJECTInclude the specified hooks or projects.
Supports flexible selector syntax:
hook-id: Run all hooks with the specified ID across all projects
project-path/: Run all hooks from the specified project
project-path:hook-id: Run only the specified hook from the specified project
Can be specified multiple times to select multiple hooks/projects.
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--help, -hDisplay the concise help for this command
--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--skip hook|projectSkip the specified hooks or projects.
Supports flexible selector syntax:
hook-id: Skip all hooks with the specified ID across all projects
project-path/: Skip all hooks from the specified project
project-path:hook-id: Skip only the specified hook from the specified project
Can be specified multiple times. Also accepts PREK_SKIP or SKIP environment variables (comma-delimited).
--verbose, -vUse verbose output
--version, -VDisplay the prek version
HOOK|PROJECTInclude the specified hooks or projects.
Supports flexible selector syntax:
hook-id: Run all hooks with the specified ID across all projects
project-path/: Run all hooks from the specified project
project-path:hook-id: Run only the specified hook from the specified project
Can be specified multiple times to select multiple hooks/projects.
--all-files, -aRun on all files in the repo
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--directory, -d dirRun hooks on all files in the specified directories.
You can specify multiple directories. It can be used in conjunction with --files.
--dry-runDo not run the hooks, but print the hooks that would have been run
--fail-fastStop running hooks after the first failure
--files filesSpecific filenames to run hooks on
--from-ref, --source, -s from-refThe original ref in a <from_ref>...<to_ref> diff expression. Files changed in this diff will be run through the hooks
--help, -hDisplay the concise help for this command
--last-commitRun hooks against the last commit. Equivalent to --from-ref HEAD~1 --to-ref HEAD
--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--show-diff-on-failureWhen hooks fail, run git diff directly afterward
--skip hook|projectSkip the specified hooks or projects.
Supports flexible selector syntax:
hook-id: Skip all hooks with the specified ID across all projects
project-path/: Skip all hooks from the specified project
project-path:hook-id: Skip only the specified hook from the specified project
Can be specified multiple times. Also accepts PREK_SKIP or SKIP environment variables (comma-delimited).
--stage, --hook-stage stageThe stage during which the hook is fired.
When specified, only hooks configured for that stage (for example manual, pre-commit, or pre-push) will run. Defaults to pre-commit if not specified. For hooks specified directly in the command line, fallback to manual stage if no hooks found for pre-commit stage.
Possible values:
manualcommit-msgpost-checkoutpost-commitpost-mergepost-rewritepre-commitpre-merge-commitpre-pushpre-rebaseprepare-commit-msg--to-ref, --origin, -o to-refThe destination ref in a from_ref...to_ref diff expression. Defaults to HEAD if from_ref is specified
--verbose, -vUse verbose output
--version, -VDisplay the prek version
HOOK|PROJECTInclude the specified hooks or projects.
Supports flexible selector syntax:
hook-id: Run all hooks with the specified ID across all projects
project-path/: Run all hooks from the specified project
project-path:hook-id: Run only the specified hook from the specified project
Can be specified multiple times to select multiple hooks/projects.
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--help, -hDisplay the concise help for this command
--hook-stage hook-stageShow only hooks that has the specified stage
Possible values:
manualcommit-msgpost-checkoutpost-commitpost-mergepost-rewritepre-commitpre-merge-commitpre-pushpre-rebaseprepare-commit-msg--language languageShow only hooks that are implemented in the specified language
Possible values:
buncondacoursierdartdenodockerdocker-imagedotnetfailgolanghaskelljulialuanodeperlpygreppythonrrubyrustscriptswiftsystem--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--output-format output-formatThe output format
[default: text]
Possible values:
textjson--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--skip hook|projectSkip the specified hooks or projects.
Supports flexible selector syntax:
hook-id: Skip all hooks with the specified ID across all projects
project-path/: Skip all hooks from the specified project
project-path:hook-id: Skip only the specified hook from the specified project
Can be specified multiple times. Also accepts PREK_SKIP or SKIP environment variables (comma-delimited).
--verbose, -vUse verbose output
--version, -VDisplay the prek version
--allUninstall all prek-managed Git shims.
Scans the hooks directory and removes every hook managed by prek, regardless of hook type.
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--help, -hDisplay the concise help for this command
--hook-type, -t hook-typeWhich Git shim(s) to uninstall.
Specifies which Git hook type(s) you want to uninstall shims for. Can be specified multiple times to uninstall shims for multiple hook types.
If not specified, uses default_install_hook_types from the config file, or defaults to pre-commit if that is also not set. Use --all to remove all prek-managed hooks.
Possible values:
commit-msgpost-checkoutpost-commitpost-mergepost-rewritepre-commitpre-merge-commitpre-pushpre-rebaseprepare-commit-msg--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--verbose, -vUse verbose output
--version, -VDisplay the prek version
CONFIGThe path to the configuration file
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--help, -hDisplay the concise help for this command
--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--verbose, -vUse verbose output
--version, -VDisplay the prek version
MANIFESTThe path to the manifest file
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--help, -hDisplay the concise help for this command
--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--verbose, -vUse verbose output
--version, -VDisplay the prek version
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--file, -f fileWrite the sample config to a file.
Defaults to .pre-commit-config.yaml unless --format toml is set, which uses prek.toml. If a path is provided without --format, the format is inferred from the file extension (.toml uses TOML).
--format formatSelect the sample configuration format
Possible values:
yamltoml--help, -hDisplay the concise help for this command
--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--verbose, -vUse verbose output
--version, -VDisplay the prek version
--bleeding-edgeUpdate to the bleeding edge of the default branch instead of the latest tagged version
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--cooldown-days daysMinimum release age (in days) required for a version to be eligible.
The age is computed from the tag creation timestamp for annotated tags, or from the tagged commit timestamp for lightweight tags. A value of 0 disables this check.
[default: 0]
--dry-runDo not write changes to the config file, only display what would be changed
--freezeStore "frozen" hashes in rev instead of tag names
--help, -hDisplay the concise help for this command
--jobs, -j jobsNumber of threads to use
[default: 0]
--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--repo repoOnly update this repository. This option may be specified multiple times
--verbose, -vUse verbose output
--version, -VDisplay the prek version
prek cache dirShow the location of the prek cache
prek cache gcRemove unused cached repositories, hook environments, and other data
prek cache cleanRemove all prek cached data
prek cache sizeShow the size of the prek cache
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--help, -hDisplay the concise help for this command
--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--verbose, -vUse verbose output
--version, -VDisplay the prek version
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--dry-runPrint what would be removed, but do not delete anything
--help, -hDisplay the concise help for this command
--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--verbose, -vUse verbose output
--version, -VDisplay the prek version
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--help, -hDisplay the concise help for this command
--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--verbose, -vUse verbose output
--version, -VDisplay the prek version
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--help, -hDisplay the concise help for this command
--human, --human-readable, -HDisplay the cache size in human-readable format (e.g., 1.2 GiB instead of raw bytes)
--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--verbose, -vUse verbose output
--version, -VDisplay the prek version
REPORepository to source hooks from
HOOK|PROJECTInclude the specified hooks or projects.
Supports flexible selector syntax:
hook-id: Run all hooks with the specified ID across all projects
project-path/: Run all hooks from the specified project
project-path:hook-id: Run only the specified hook from the specified project
Can be specified multiple times to select multiple hooks/projects.
--all-files, -aRun on all files in the repo
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--directory, -d dirRun hooks on all files in the specified directories.
You can specify multiple directories. It can be used in conjunction with --files.
--dry-runDo not run the hooks, but print the hooks that would have been run
--fail-fastStop running hooks after the first failure
--files filesSpecific filenames to run hooks on
--from-ref, --source, -s from-refThe original ref in a <from_ref>...<to_ref> diff expression. Files changed in this diff will be run through the hooks
--help, -hDisplay the concise help for this command
--last-commitRun hooks against the last commit. Equivalent to --from-ref HEAD~1 --to-ref HEAD
--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--rev, --ref revManually select a rev to run against, otherwise the HEAD revision will be used
--show-diff-on-failureWhen hooks fail, run git diff directly afterward
--skip hook|projectSkip the specified hooks or projects.
Supports flexible selector syntax:
hook-id: Skip all hooks with the specified ID across all projects
project-path/: Skip all hooks from the specified project
project-path:hook-id: Skip only the specified hook from the specified project
Can be specified multiple times. Also accepts PREK_SKIP or SKIP environment variables (comma-delimited).
--stage, --hook-stage stageThe stage during which the hook is fired.
When specified, only hooks configured for that stage (for example manual, pre-commit, or pre-push) will run. Defaults to pre-commit if not specified. For hooks specified directly in the command line, fallback to manual stage if no hooks found for pre-commit stage.
Possible values:
manualcommit-msgpost-checkoutpost-commitpost-mergepost-rewritepre-commitpre-merge-commitpre-pushpre-rebaseprepare-commit-msg--to-ref, --origin, -o to-refThe destination ref in a from_ref...to_ref diff expression. Defaults to HEAD if from_ref is specified
--verbose, -vUse verbose output
--version, -VDisplay the prek version
prek util identifyShow file identification tags
prek util list-builtinsList all built-in hooks bundled with prek
prek util init-template-dirInstall Git shims in a directory intended for use with git config init.templateDir
prek util yaml-to-tomlConvert a YAML configuration file to prek.toml
PATHThe path(s) to the file(s) to identify
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--help, -hDisplay the concise help for this command
--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--output-format output-formatThe output format
[default: text]
Possible values:
textjson--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--verbose, -vUse verbose output
--version, -VDisplay the prek version
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--help, -hDisplay the concise help for this command
--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--output-format output-formatThe output format
[default: text]
Possible values:
textjson--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--verbose, -vUse verbose output
--version, -VDisplay the prek version
DIRECTORYThe directory in which to write the Git shim
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--help, -hDisplay the concise help for this command
--hook-type, -t hook-typeWhich Git shim(s) to install.
Specifies which Git hook type(s) you want to install shims for. Can be specified multiple times to install shims for multiple hook types.
If not specified, uses default_install_hook_types from the config file, or defaults to pre-commit if that is also not set.
Possible values:
commit-msgpost-checkoutpost-commitpost-mergepost-rewritepre-commitpre-merge-commitpre-pushpre-rebaseprepare-commit-msg--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-allow-missing-configAssume cloned repos should have a pre-commit config
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--verbose, -vUse verbose output
--version, -VDisplay the prek version
CONFIGThe YAML configuration file to convert. If omitted, discovers .pre-commit-config.yaml or .pre-commit-config.yml in the current directory
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--forceOverwrite the output file if it already exists
--help, -hDisplay the concise help for this command
--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--output, -o outputPath to write the generated prek.toml file. Defaults to prek.toml in the same directory as the input file
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--verbose, -vUse verbose output
--version, -VDisplay the prek version
prek self updateUpdate prek
TARGET_VERSIONUpdate to the specified version. If not provided, prek will update to the latest version
--cd, -C dirChange to directory before running
--color colorWhether to use color in output
May also be set with the PREK_COLOR environment variable.
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output--config, -c configPath to alternate config file
--help, -hDisplay the concise help for this command
--log-file log-fileWrite trace logs to the specified file. If not specified, trace logs will be written to $PREK_HOME/prek.log
--no-progressHide all progress outputs.
For example, spinners or progress bars.
--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.
May also be set with the PREK_QUIET environment variable.
--refreshRefresh all cached data
--token tokenA GitHub token for authentication. A token is not required but can be used to reduce the chance of encountering rate limits
May also be set with the GITHUB_TOKEN environment variable.
--verbose, -vUse verbose output
--version, -VDisplay the prek version