🪝 Hooks
🔧 Management
Install, uninstall, and manage hooks
Installing Hooks
# Install all configured hooks
guardy hooks install
# Force reinstall (overwrites existing hooks)
guardy hooks install --forceThis creates Git hooks in .git/hooks/ directory.
Uninstalling Hooks
# Remove all Guardy hooks
guardy hooks uninstallRunning Hooks Manually
Test hooks without committing:
# Run pre-commit hook
guardy hooks run pre-commit
# Run on specific files
guardy hooks run pre-commit --files src/main.rs,src/lib.rs
# Test commit message validation
guardy hooks run commit-msg --message "feat: add new feature"Listing Hooks
# Show installed hooks
guardy hooks list
# Output:
# ✓ pre-commit (installed)
# ✓ commit-msg (installed)
# ✗ pre-push (not installed)Bypassing Hooks
Use sparingly! Bypassing hooks can introduce security risks.
Skip All Hooks
GUARDY_SKIP=1 git commit -m "emergency: fix production"Skip Specific Hook
GUARDY_SKIP_PRE_COMMIT=1 git commit -m "wip: debugging"
GUARDY_SKIP_COMMIT_MSG=1 git commit -m "quick fix"Git Native Bypass
git commit --no-verify -m "bypass all hooks"Troubleshooting
Hook Not Running
# Check if hooks are installed
guardy hooks list
# Reinstall if needed
guardy hooks install --forceDebug Output
# Enable verbose output
GUARDY_DEBUG=1 git commit -m "test"
# Or use verbose flag
guardy hooks run pre-commit --verbosePermission Issues
# Ensure hooks are executable
chmod +x .git/hooks/pre-commit
chmod +x .git/hooks/commit-msgPerformance Issues
- Enable parallel execution
- Use glob patterns to limit file processing
- Consider moving heavy checks to pre-push
- Use caching when available