All apps/pre-commit

pre-commit

pre-commit

Framework for managing and running multi-language Git hooks.

Runs as pre-commit|macOS, Linux, Windows|pre-commit.com

Command form

ai-draft · 4 tasks · 15 fields

Run hooks, install the Git hook script or update hook versions. Other subcommands and stage-specific ref options are not covered.

Opens the form; the finished command lands at your prompt, unrun
otty gui pre-commit

pre-commit run

Run hooks

Run configured hooks on staged files, all files or a chosen file list.

Run hooksExample values, fixed in this page — nothing here reaches a terminal
Basic
Hook id
string
All files
--all-files
Show diff on failure
--show-diff-on-failure
Verbose
--verbose
TasksEach one presets the form for one job
Run on all files
hookall_filesshow_diffverbose
Run on staged files
hookverboseshow_diff
ParametersOnly these flags are editable in the form
Hook id
Run only this hook; leave empty to run all.
string · positional 0
All files
boolean
--all-files-a
Specific files
path · repeatable
--files
Show diff on failure
boolean
--show-diff-on-failure
Verbose
boolean
--verbose-v
Config file
path
--config-c
Hook stage
enum
--hook-stagepre-commitpre-merge-commitpre-pushprepare-commit-msgcommit-msgpost-commitpost-checkoutpost-mergepost-rewrite

pre-commit install

Install Git hook

Install the pre-commit script into the repository's .git/hooks.

Install Git hookExample values, fixed in this page — nothing here reaches a terminal
Basic
Hook type
9 choicesenum
Overwrite existing hooks
--overwrite
Config file
file
Allow missing config
--allow-missing-config
TasksEach one presets the form for one job
Install hook
hook_typeoverwriteconfigallow_missing
ParametersOnly these flags are editable in the form
Hook type
enum
--hook-type-tpre-commitpre-merge-commitpre-pushprepare-commit-msgcommit-msgpost-commitpost-checkoutpost-mergepost-rewrite
Overwrite existing hooks
boolean
--overwrite-f
Config file
path
--config-c
Allow missing config
boolean
--allow-missing-config

pre-commit autoupdate

Update hook versions

Update the repos in the config to their latest versions.

Update hook versionsExample values, fixed in this page — nothing here reaches a terminal
Basic
Freeze to hashes
--freeze
Bleeding edge of master
--bleeding-edge
Only this repo
string
Config file
file
TasksEach one presets the form for one job
Update
freezebleeding_edgerepoconfig
ParametersOnly these flags are editable in the form
Freeze to hashes
boolean
--freeze
Bleeding edge of master
boolean
--bleeding-edge
Only this repo
string · repeatable
--repo
Config file
path
--config-c
SourcesEvery flag above is checked against these
fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

Before it fills your prompt, Otty checks the installed pre-commit against its version. A form that does not match your version is not offered.