| Crates.io | hookman |
| lib.rs | hookman |
| version | 1.0.0 |
| created_at | 2025-05-18 15:29:36.593431+00 |
| updated_at | 2025-07-10 13:25:32.291381+00 |
| description | Add hooks to your Git repository using a TOML file. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1678733 |
| size | 34,346 |
Add hooks to your Git repository using a TOML file.
chmod +x commands or perm-handling is needed. hookman does it all for you.The usage is pretty straightforward.
When inside the directory of a Git repository, create a new hookman.toml file with the following structure:
[hook.<event>] # the hook type/event (pre-commit, update etc.)
run = "<command>" # you can either have a `run` field with the command itself
script = "<script path>" # or, your personal script inside the directory
For example:
[hook.pre-commit]
run = "pip install -U -r requirements.txt && pip list > requirements.txt"
[hook.pre-push]
script = "scripts/bundle-app.sh"
hookman build
# or use this command to use the current shell for hook execution later on
hookman build --use-current-shell
With this command, hookman handles all script permissions, relocation and other mundane tasks without you ever having to touch it.
hookman list
hookman list-events
hookman clean
Install using cargo:
cargo install hookman
Or, you can set it up globally using mise:
# Note: This will compile the binary for your system.
mise use -g cargo:hookman
For macOS, you can install using Homebrew:
brew install hitblast/tap/hookman
If your platform isn't enlisted here, you can opt for the compressed binary downloads in the GitHub Releases section of the repository.
Note than on devices running macOS, you'll have to remove the quarantine attribute from the binary:
xattr -d com.apple.quarantine bin/hookman # inside extracted zip
hookman is a very tiny project for those who'd like to use an extremely minimal setup for managing git hooks, so I don't think there is a need to follow a mandatory set of rules for contribution. Anyhow, pull requests, and new issues regarding feature suggestions, bug fixes or new ideas are always welcome!
Licensed under the MIT License. Please check LICENSE for more information.