| Crates.io | git-hook-installer |
| lib.rs | git-hook-installer |
| version | 3.0.1 |
| created_at | 2026-01-11 21:33:08.63629+00 |
| updated_at | 2026-01-13 15:16:43.931649+00 |
| description | Install basic premade git hooks into the current repository. |
| homepage | https://github.com/pRizz/git-hook-installer |
| repository | https://github.com/pRizz/git-hook-installer |
| max_upload_size | |
| id | 2036487 |
| size | 121,423 |
A small Rust CLI that installs premade git hooks into the current repository.
From crates.io:
cargo install git-hook-installer
Or from source (this repo):
cargo install --path .
Run with no arguments to offer to install/update the managed pre-commit hook:
git-hook-installer
Recursively install/update the managed pre-commit hook across many repos under a directory:
# scans current directory
git-hook-installer install-recursive
# or pass an explicit directory to scan
git-hook-installer install-recursive ~/src
# increase scan depth (default is 1)
git-hook-installer install-recursive --max-depth 3 ~/src
# skip the confirmation prompt
git-hook-installer --yes install-recursive ~/src
Inspect the current hook state:
git-hook-installer status
Install/update the managed pre-commit hook directly:
git-hook-installer install pre-commit
Disable the managed pre-commit block (without removing it):
git-hook-installer disable
Uninstall the managed pre-commit block (preserves any other pre-commit logic you already had):
git-hook-installer uninstall
If your repo has multiple Cargo.toml files (monorepo), pick which one the hook should use:
git-hook-installer install pre-commit --manifest-dir crates/my-crate
.git (supports worktrees where .git is a file).install-recursive [DIR] scans for git repos under a directory and runs the installer in each repo (shows a count + directory preview and asks for confirmation unless --yes). The default scan depth is 1, configurable via --max-depth.--force / --yes)..git/hooks/pre-commit contains a managed block (marked with git-hook-installer begin/end markers) which can run a set of formatters/linters and re-stage changes..git/hooks/ (nothing is written to your repository).git-hook-installer tries to determine which languages your repo actually uses.git-hook-installer install pre-commit to re-detect and regenerate the hook.--non-interactive mode it stays quiet.package.json / lockfiles / tsconfig.json / jsconfig.json / Biome / ESLint / Prettier config, or a shallow scan that finds JS/TS source files.
tsc --noEmit typecheck when staged changes include *.ts/*.tsx or tsconfig.json (uses tsc on PATH or npx --yes tsc).pyproject.toml, requirements/setup files, common lockfiles, or a shallow scan that finds .py files..java/.kt/.kts files.go.mod/go.work/go.sum, or a shallow scan that finds .go files.Gemfile / .ruby-version / Rakefile, or a shallow scan that finds .rb files..shellcheckrc / .shfmt, or a shallow scan that finds shell scripts..terraform.lock.hcl, or a shallow scan that finds .tf/.tfvars files..clang-format, or a shallow scan that finds common C/C++ file extensions.cargo fmt only runs when a Cargo manifest directory was resolved (or passed via --manifest-dir).git stash push --keep-index --include-untracked, runs auto-fix on the staged files, re-stages, and then restores the stash.git-hook-installer modifies .git/hooks/pre-commit, it snapshots the current file to .git/hooks/pre-commit.snapshot-YYYY-MM-DD-HH-MM-SS and keeps the newest 10 snapshots by default.-y, --yes: auto-confirm prompts--non-interactive: never prompt (fails on ambiguity or existing hooks unless --force)-f, --force: overwrite existing hook (backs it up first)