Skip to main content

vulkro install-hook

Install or update git hooks that run Vulkro before a commit or push.

install-hook manages a marked block inside the hook file, so re-running it is idempotent and it composes with an existing husky or hand-written hook instead of refusing. With no selector, it installs both hooks.

The generated hook keeps your code on the machine: your source, file paths, and findings are never sent anywhere.

  • pre-commit runs the new-findings gate against HEAD. vulkro gate makes no outbound request at all.
  • pre-push runs a fast high-confidence quick scan of src. The scan path can send the usage heartbeat (at most once every 24 hours, on a background thread, and it never blocks or delays the push).

If the hook must be network-silent, set VULKRO_OFFLINE=1 (or VULKRO_NO_HEARTBEAT=1) in the environment the hook runs in.

Bypass once with VULKRO_SKIP_HOOKS=1.

Usage

vulkro install-hook [FLAGS]

Flags

FlagDescription
--pre-commitManage the pre-commit hook.
--pre-pushManage the pre-push hook (the last gate before code leaves the machine).
--uninstallRemove the Vulkro-managed block instead of installing it.
--forceReplace the whole hook file with just the Vulkro block. The default composes with any existing content.

Exit codes

  • 0 hook(s) installed, updated, or removed.
  • 2 not in a git repo, or a write failure.

The generated hook itself returns 1 on findings at commit or push time.

Examples

# Install both hooks, composing with anything already there.
vulkro install-hook

# Only the pre-push gate.
vulkro install-hook --pre-push

# Remove the Vulkro block from both hooks.
vulkro install-hook --uninstall

# Skip the hook for one commit.
VULKRO_SKIP_HOOKS=1 git commit -m "wip"