git-hook-installer 1.0.0

Install basic premade git hooks into the current repository.
git-hook-installer-1.0.0 is not a library.

git-hook-installer

A small Rust CLI that installs premade git hooks into the current repository.

Install

From source (this repo):

cargo install --path .

Usage

Run with no arguments to auto-detect a Cargo/Rust repo and offer to install a pre-commit hook:

git-hook-installer

Inspect the current hook state:

git-hook-installer status

Install the cargo fmt pre-commit hook directly:

git-hook-installer install cargo-fmt-pre-commit

If your repo has multiple Cargo.toml files (monorepo), pick which one the hook should use:

git-hook-installer install cargo-fmt-pre-commit --manifest-dir crates/my-crate

Behavior

  • git repo detection: walks up parent directories looking for .git (supports worktrees where .git is 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-commit runs cargo fmt to 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)