vulkro install-hook
Installs git hooks that run Vulkro before a commit or push.
vulkro install-hook # both hooks
vulkro install-hook --pre-push # only the pre-push hook
VULKRO_SKIP_HOOKS=1 git commit -m "wip" # skip the hooks once
The hook file gets a marked Vulkro block, so re-running is safe and it works alongside husky or a hand-written hook.
- pre-commit runs
vulkro ctx check --staged(call sites left on an old signature, removed names still used, syntax errors), then the new-findings gate againstHEAD. The ctx step warns unless you pass--block-on-ctx-check. - pre-push runs a quick, high-confidence scan of
src.
Your source, paths and findings never leave the machine. Set VULKRO_OFFLINE=1 in the hook's environment for a fully network-silent hook. Without a licence the hooks print a notice ending in vulkro: license_required and let the git operation continue.
Flags
| Flag | Description |
|---|---|
--pre-commit | Manage only the pre-commit hook. |
--pre-push | Manage only the pre-push hook. |
--uninstall | Remove the Vulkro block. |
--force | Replace the whole hook file with the Vulkro block. |
--block-on-ctx-check | Make the pre-commit ctx check block the commit. |
Exit codes
0 hooks installed, updated or removed. 2 not a git repo, or a write failure. The hook itself returns 1 on findings.
See also: vulkro gate, vulkro guard.
Command reference
Generated from vulkro install-hook --help (vulkro 0.41.0). Run scripts/gen-docs.sh in the product repository to refresh it; do not edit this section by hand.
Install or update git hooks that run Vulkro before a commit or push.
vulkro install-hook [OPTIONS]
Options
| Flag | Description |
|---|---|
--offline | Hard-disable every outbound network call for this run (sets VULKRO_OFFLINE=1). Blocks the CVE feed, the license heartbeat, the update check, webhooks, and any cloud AI endpoint; a loopback model (http://127.0.0.1, http://localhost) is still allowed. Equivalent to exporting VULKRO_OFFLINE=1, and the flag wins when both are set. |
--pre-commit | Manage the pre-commit hook. |
--pre-push | Manage the pre-push hook (the last gate before code leaves the machine) |
-q, --quiet | Print only warnings and errors on stderr: no progress, tips or next-step hints. Results on stdout and exit codes are unchanged. |
--no-color | Turn off coloured output. Colour is also off when NO_COLOR is set to a non-empty value or TERM=dumb. |
--uninstall | Remove the vulkro-managed block instead of installing it. |
--force | Replace the whole hook file with just the vulkro block (the default composes with any existing content) |
--block-on-ctx-check | Make the pre-commit vulkro ctx check step block a commit that leaves call sites on an old signature, removed names still used, or syntax errors. Default: it prints them and the commit goes on. |
-h, --help | Print help (see a summary with '-h') |
Full vulkro install-hook --help
Install or update git hooks that run Vulkro before a commit or push.
Install or update git hooks that run vulkro before a commit or push. The pre-commit hook first runs `vulkro ctx check --staged --fast` (call sites left on an old signature, removed names still used, syntax errors): it warns, or blocks with `--block-on-ctx-check`. Manages a marked block inside the hook file, so re-running is idempotent and it composes with an existing husky / hand-written hook instead of refusing (it replaces the deprecated whole-file scaffolder `vulkro init`). With no selector, installs both. Your source, file paths, and findings never leave the machine: pre-commit runs the new-findings gate against HEAD (no outbound request at all); pre-push runs a fast high-confidence quick scan of `src`, whose path can send the usage heartbeat (at most once every 6 hours, plus once an hour after a scan, on a background thread). Set `VULKRO_OFFLINE=1` for a network-silent hook. Bypass once with `VULKRO_SKIP_HOOKS=1`.
The hooks need a licence to check anything. On a machine without one they never block a commit or a push for a licence reason: each prints one notice ending in `vulkro: license_required`, checks nothing, and lets the git operation continue.
Environment variables: VULKRO_SKIP_HOOKS Set to 1 to bypass the hooks for one commit or push. VULKRO_GIT_HOOK Exported by the generated hooks (set to the hook name) so the command a hook runs knows it is inside a git hook. Not something you set yourself.
Exit code: 0 = hook(s) installed / updated / removed, 2 = not in a git repo or a write failure. (The generated hook itself returns 1 on findings at commit / push time.)
Usage: vulkro install-hook [OPTIONS]
Options:
--offline
Hard-disable every outbound network call for this run (sets VULKRO_OFFLINE=1). Blocks the CVE feed, the license heartbeat, the update check, webhooks, and any cloud AI endpoint; a loopback model (http://127.0.0.1, http://localhost) is still allowed. Equivalent to exporting VULKRO_OFFLINE=1, and the flag wins when both are set
--pre-commit
Manage the pre-commit hook
--pre-push
Manage the pre-push hook (the last gate before code leaves the machine)
-q, --quiet
Print only warnings and errors on stderr: no progress, tips or next-step hints. Results on stdout and exit codes are unchanged
--no-color
Turn off coloured output. Colour is also off when NO_COLOR is set to a non-empty value or TERM=dumb
--uninstall
Remove the vulkro-managed block instead of installing it
--force
Replace the whole hook file with just the vulkro block (the default composes with any existing content)
--block-on-ctx-check
Make the pre-commit `vulkro ctx check` step block a commit that leaves call sites on an old signature, removed names still used, or syntax errors. Default: it prints them and the commit goes on
-h, --help
Print help (see a summary with '-h')