vulkro init and vulkro install-hook
Two ways to wire Vulkro into your local git workflow so a scan runs before code leaves the machine.
vulkro init
Scaffold a pre-commit hook that runs vulkro gate --base HEAD on staged
files. The gate fails a commit ONLY on findings new vs HEAD, so
pre-existing technical debt never blocks a commit.
vulkro init --pre-commit
| Flag | Description |
|---|---|
--pre-commit | Install a pre-commit hook that runs vulkro gate --base HEAD on staged files. |
--force | Overwrite the target hook file if it already exists. |
Exit codes: 0 installed, 2 error (not a git repo, hook already exists
without --force, or a filesystem write failure).
vulkro install-hook
Install or update git hooks that run Vulkro before a commit or push. It manages a marked block inside the hook file, so re-running is idempotent and it composes with an existing Husky or hand-written hook instead of refusing. With no selector, it installs both hooks.
vulkro install-hook # install both pre-commit and pre-push
vulkro install-hook --pre-commit # just the pre-commit hook
vulkro install-hook --uninstall # remove the vulkro-managed block
| Flag | Description |
|---|---|
--pre-commit | Manage the pre-commit hook (runs the new-findings gate against HEAD). |
--pre-push | Manage the pre-push hook (a fast high-confidence quick scan of src, the last gate before code leaves the machine). |
--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). |
The generated hook is fully offline. Bypass it once with
VULKRO_SKIP_HOOKS=1.
Exit codes: 0 hooks installed / updated / removed; 2 not in a git repo
or a write failure. (The generated hook itself returns 1 on findings at
commit or push time.)
Which one?
init --pre-commitis a quick scaffold of a single pre-commit gate.install-hookmanages both pre-commit and pre-push, composes with existing hooks, and is idempotent to re-run.
Related
vulkro gate- the fail-on-new-only gate the hooks run.vulkro scan- the quick preset the pre-push hook uses.- CI/CD integration - the server-side gate.