vis hook
Manage git hooks for your workspace
vis hook
Manage git hooks for your workspace. Supports installing, uninstalling, and migrating from husky.
Usage
vis hook <action> [options]Actions
install
Install git hooks by configuring core.hooksPath to point to your hooks directory:
vis hook installuninstall
Remove git hooks and reset core.hooksPath:
vis hook uninstallmigrate
Migrate existing husky hooks to vis:
vis hook migrateThe migration automatically detects your husky directory, copies hook scripts, and prompts for confirmation.
Options
| Option | Default | Description |
|---|---|---|
--hooks-dir | .vis-hooks | Custom hooks directory |
Environment Variables
| Variable | Description |
|---|---|
VIS_GIT_HOOKS=0 | Disable git hooks |
VIS_GIT_HOOKS=2 | Enable debug output for hooks |
Supported Hooks
vis supports all standard git hooks:
pre-commitpre-merge-commitprepare-commit-msgcommit-msgpost-commitapplypatch-msgpre-applypatchpost-applypatchpre-rebasepost-rewritepost-checkoutpost-mergepre-pushpre-auto-gc
Creating Hook Scripts
After installing, create executable scripts in your hooks directory:
vis hook install
echo '#!/bin/sh
pnpm run lint-staged' > .vis-hooks/pre-commit
chmod +x .vis-hooks/pre-commitCommit the hooks directory to version control so all team members use the same hooks.