Skip to main content

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
FlagDescription
--pre-commitInstall a pre-commit hook that runs vulkro gate --base HEAD on staged files.
--forceOverwrite 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
FlagDescription
--pre-commitManage the pre-commit hook (runs the new-findings gate against HEAD).
--pre-pushManage the pre-push hook (a fast high-confidence quick scan of src, 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).

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-commit is a quick scaffold of a single pre-commit gate.
  • install-hook manages both pre-commit and pre-push, composes with existing hooks, and is idempotent to re-run.