git-hook-installer-1.0.2 is not a library.
git-hook-installer
A small Rust CLI that installs premade git hooks into the current repository.
Install
From crates.io:
Or from source (this repo):
Usage
Run with no arguments to auto-detect a Cargo/Rust repo and offer to install a pre-commit hook:
Inspect the current hook state:
Install the cargo fmt pre-commit hook directly:
If your repo has multiple Cargo.toml files (monorepo), pick which one the hook should use:
Behavior
- git repo detection: walks up parent directories looking for
.git(supports worktrees where.gitis a file). - safe overwrites: if a hook already exists, it will prompt before backing it up (or use
--force/--yes). - hook installed:
.git/hooks/pre-commitrunscargo fmtto format code before committing (does not block commits).
Options
-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)