fix #1550 cargo run -- identify .gitignore Cargo.lock README.md .github/ output ``` .gitignore Tags: file, non-executable, text, gitignore Cargo.lock Tags: file, non-executable, text, toml, cargo-lock README.md Tags: file, non-executable, text, plain-text, markdown .github/ Tags: directory ``` --------- Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
67 KiB
CLI Reference
prek
Better pre-commit, re-engineered in Rust
Usage
prek [OPTIONS] [HOOK|PROJECT]... [COMMAND]
Commands
prek installInstall the prek git hook
prek install-hooksCreate hook environments for all hooks used in the config file
prek runRun hooks
prek listList available hooks
prek identifyShow file identification tags
prek uninstallUninstall the prek git hook
prek validate-configValidate
.pre-commit-config.yamlfilesprek validate-manifestValidate
.pre-commit-hooks.yamlfilesprek sample-configProduce a sample
.pre-commit-config.yamlfileprek auto-updateAuto-update pre-commit config to the latest repos' versions
prek cacheManage the prek cache
prek init-template-dirInstall hook script in a directory intended for use with
git config init.templateDirprek try-repoTry the pre-commit hooks in the current repo
prek selfprekself management
prek install
Install the prek git hook
Usage
prek install [OPTIONS] [HOOK|PROJECT]...
Arguments
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.
-
Options
--allow-missing-configAllow a missing
pre-commitconfiguration file--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--help,-hDisplay the concise help for this command
--hook-type,-thook-typeWhich hook type(s) to install.
Specifies which git hook stage(s) you want to install the hook script for. Can be specified multiple times to install hooks for multiple stages.
If not specified, uses
default_install_hook_typesfrom the config file, or defaults topre-commitif that is also not set.Note: This is different from a hook's
stagesparameter 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
--install-hooksCreate hook environments for all hooks used in the config file
--log-filelog-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 hooks
--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_QUIETenvironment variable.--refreshRefresh all cached data
--skiphook|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_SKIPorSKIPenvironment variables (comma-delimited).-
--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek install-hooks
Create hook environments for all hooks used in the config file.
This command does not install the git hook. To install the git hook along with the hook environments in one command, use prek install --install-hooks.
Usage
prek install-hooks [OPTIONS] [HOOK|PROJECT]...
Arguments
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.
-
Options
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--help,-hDisplay the concise help for this command
--log-filelog-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_QUIETenvironment variable.--refreshRefresh all cached data
--skiphook|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_SKIPorSKIPenvironment variables (comma-delimited).-
--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek run
Run hooks
Usage
prek run [OPTIONS] [HOOK|PROJECT]...
Arguments
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.
-
Options
--all-files,-aRun on all files in the repo
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--directory,-ddirRun 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
--filesfilesSpecific filenames to run hooks on
--from-ref,--source,-sfrom-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-filelog-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_QUIETenvironment variable.--refreshRefresh all cached data
--show-diff-on-failureWhen hooks fail, run
git diffdirectly afterward--skiphook|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_SKIPorSKIPenvironment variables (comma-delimited).-
--stage,--hook-stagestageThe stage during which the hook is fired.
When specified, only hooks configured for that stage (for example
manual,pre-commit, orpre-commit) will run. Defaults topre-commitif not specified. For hooks specified directly in the command line, fallback tomanualstage if no hooks found forpre-commitstage.Possible values:
manualcommit-msgpost-checkoutpost-commitpost-mergepost-rewritepre-commitpre-merge-commitpre-pushpre-rebaseprepare-commit-msg
--to-ref,--origin,-oto-refThe destination ref in a
from_ref...to_refdiff expression. Defaults toHEADiffrom_refis specified--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek list
List available hooks
Usage
prek list [OPTIONS] [HOOK|PROJECT]...
Arguments
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.
-
Options
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--help,-hDisplay the concise help for this command
--hook-stagehook-stageShow only hooks that has the specified stage
Possible values:
manualcommit-msgpost-checkoutpost-commitpost-mergepost-rewritepre-commitpre-merge-commitpre-pushpre-rebaseprepare-commit-msg
--languagelanguageShow only hooks that are implemented in the specified language
Possible values:
buncondacoursierdartdockerdocker-imagedotnetfailgolanghaskelljulialuanodeperlpygreppythonrrubyrustscriptswiftsystem
--log-filelog-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-formatoutput-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_QUIETenvironment variable.--refreshRefresh all cached data
--skiphook|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_SKIPorSKIPenvironment variables (comma-delimited).-
--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek identify
Show file identification tags
Usage
prek identify [OPTIONS] [PATH]...
Arguments
PATHThe path(s) to the file(s) to identify
Options
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--help,-hDisplay the concise help for this command
--log-filelog-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-formatoutput-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_QUIETenvironment variable.--refreshRefresh all cached data
--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek uninstall
Uninstall the prek git hook
Usage
prek uninstall [OPTIONS]
Options
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--help,-hDisplay the concise help for this command
--hook-type,-thook-typeWhich hook type(s) to uninstall.
Specifies which git hook stage(s) you want to uninstall. Can be specified multiple times to uninstall hooks for multiple stages.
If not specified, uses
default_install_hook_typesfrom the config file, or defaults topre-commitif that is also not set.Possible values:
commit-msgpost-checkoutpost-commitpost-mergepost-rewritepre-commitpre-merge-commitpre-pushpre-rebaseprepare-commit-msg
--log-filelog-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_QUIETenvironment variable.--refreshRefresh all cached data
--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek validate-config
Validate .pre-commit-config.yaml files
Usage
prek validate-config [OPTIONS] [CONFIG]...
Arguments
CONFIGThe path to the configuration file
Options
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--help,-hDisplay the concise help for this command
--log-filelog-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_QUIETenvironment variable.--refreshRefresh all cached data
--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek validate-manifest
Validate .pre-commit-hooks.yaml files
Usage
prek validate-manifest [OPTIONS] [MANIFEST]...
Arguments
MANIFESTThe path to the manifest file
Options
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--help,-hDisplay the concise help for this command
--log-filelog-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_QUIETenvironment variable.--refreshRefresh all cached data
--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek sample-config
Produce a sample .pre-commit-config.yaml file
Usage
prek sample-config [OPTIONS]
Options
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--file,-ffileWrite the sample config to a file (
.pre-commit-config.yamlby default)--help,-hDisplay the concise help for this command
--log-filelog-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_QUIETenvironment variable.--refreshRefresh all cached data
--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek auto-update
Auto-update pre-commit config to the latest repos' versions
Usage
prek auto-update [OPTIONS]
Options
--bleeding-edgeUpdate to the bleeding edge of the default branch instead of the latest tagged version
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--cooldown-daysdaysMinimum 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
0disables this check.[default: 0]
--dry-runDo not write changes to the config file, only display what would be changed
--freezeStore "frozen" hashes in
revinstead of tag names--help,-hDisplay the concise help for this command
--jobs,-jjobsNumber of threads to use
[default: 0]
--log-filelog-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_QUIETenvironment variable.--refreshRefresh all cached data
--reporepoOnly update this repository. This option may be specified multiple times
--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek cache
Manage the prek cache
Usage
prek cache [OPTIONS] <COMMAND>
Commands
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
prek cache dir
Show the location of the prek cache
Usage
prek cache dir [OPTIONS]
Options
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--help,-hDisplay the concise help for this command
--log-filelog-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_QUIETenvironment variable.--refreshRefresh all cached data
--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek cache gc
Remove unused cached repositories, hook environments, and other data
Usage
prek cache gc [OPTIONS]
Options
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--dry-runPrint what would be removed, but do not delete anything
--help,-hDisplay the concise help for this command
--log-filelog-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_QUIETenvironment variable.--refreshRefresh all cached data
--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek cache clean
Remove all prek cached data
Usage
prek cache clean [OPTIONS]
Options
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--help,-hDisplay the concise help for this command
--log-filelog-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_QUIETenvironment variable.--refreshRefresh all cached data
--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek cache size
Show the size of the prek cache
Usage
prek cache size [OPTIONS]
Options
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath 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 GiBinstead of raw bytes)--log-filelog-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_QUIETenvironment variable.--refreshRefresh all cached data
--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek init-template-dir
Install hook script in a directory intended for use with git config init.templateDir
Usage
prek init-template-dir [OPTIONS] <DIRECTORY>
Arguments
DIRECTORYThe directory in which to write the hook script
Options
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--help,-hDisplay the concise help for this command
--hook-type,-thook-typeWhich hook type(s) to install.
Specifies which git hook stage(s) you want to install the hook script for. Can be specified multiple times to install hooks for multiple stages.
If not specified, uses
default_install_hook_typesfrom the config file, or defaults topre-commitif that is also not set.Possible values:
commit-msgpost-checkoutpost-commitpost-mergepost-rewritepre-commitpre-merge-commitpre-pushpre-rebaseprepare-commit-msg
--log-filelog-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-commitconfig--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_QUIETenvironment variable.--refreshRefresh all cached data
--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek try-repo
Try the pre-commit hooks in the current repo
Usage
prek try-repo [OPTIONS] <REPO> [HOOK|PROJECT]...
Arguments
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.
-
Options
--all-files,-aRun on all files in the repo
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--directory,-ddirRun 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
--filesfilesSpecific filenames to run hooks on
--from-ref,--source,-sfrom-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-filelog-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_QUIETenvironment variable.--refreshRefresh all cached data
--rev,--refrevManually select a rev to run against, otherwise the
HEADrevision will be used--show-diff-on-failureWhen hooks fail, run
git diffdirectly afterward--skiphook|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_SKIPorSKIPenvironment variables (comma-delimited).-
--stage,--hook-stagestageThe stage during which the hook is fired.
When specified, only hooks configured for that stage (for example
manual,pre-commit, orpre-commit) will run. Defaults topre-commitif not specified. For hooks specified directly in the command line, fallback tomanualstage if no hooks found forpre-commitstage.Possible values:
manualcommit-msgpost-checkoutpost-commitpost-mergepost-rewritepre-commitpre-merge-commitpre-pushpre-rebaseprepare-commit-msg
--to-ref,--origin,-oto-refThe destination ref in a
from_ref...to_refdiff expression. Defaults toHEADiffrom_refis specified--verbose,-vUse verbose output
--version,-VDisplay the prek version
prek self
prek self management
Usage
prek self [OPTIONS] <COMMAND>
Commands
prek self updateUpdate prek
prek self update
Update prek
Usage
prek self update [OPTIONS] [TARGET_VERSION]
Arguments
TARGET_VERSIONUpdate to the specified version. If not provided, prek will update to the latest version
Options
--cd,-CdirChange to directory before running
--colorcolorWhether to use color in output
May also be set with the
PREK_COLORenvironment 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,-cconfigPath to alternate config file
--help,-hDisplay the concise help for this command
--log-filelog-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_QUIETenvironment variable.--refreshRefresh all cached data
--tokentokenA 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_TOKENenvironment variable.--verbose,-vUse verbose output
--version,-VDisplay the prek version