Docs
Wire VeriFlow into pre-commit
Drop VeriFlow into your existing husky or pre-commit framework so every commit gets a VeriFlow review before it lands — and a oneshot shortcut when the staged set is empty.
The hook only reviews files you actually staged — git diff --cached --name-only --diff-filter=ACMR — and short-circuits to a clean exit 0 when nothing is staged.
Configure snippet
Drop in your repo URL and branch. The shell snippet and the YAML block update as you type.
Accepts a github.com HTTPS URL — everything else falls back to owner/name.
Defaults to main — overridable at runtime via VERIFLOW_BRANCH.
Before the hook runs, export VERIFLOW_API_KEY and VERIFLOW_REPO (owner/name) in your shell — both are referenced verbatim by the snippet.
Shell hook
Save as
.git/hooks/veriflow-pre-commit and chmod +x it.#!/usr/bin/env bash
# VeriFlow pre-commit hook — review only the staged set, skip when empty.
# Requires: $VERIFLOW_API_KEY and $VERIFLOW_REPO=owner/repo in your env.
set -e
branch="${VERIFLOW_BRANCH:-main}"
staged=$(git diff --cached --name-only --diff-filter=ACMR)
if [ -z "$staged" ]; then
echo "No staged files — skipping VeriFlow review."
exit 0
fi
veriflow review $staged \
--repo="${VERIFLOW_REPO:-owner/repo}" \
--branch="$branch" \
--api-key="$VERIFLOW_API_KEY"
.pre-commit-config.yaml
Drop into your repo root if you use the
pre-commit framework.repos:
- repo: local
hooks:
- id: veriflow-review
name: VeriFlow pre-commit review
entry: bash .git/hooks/veriflow-pre-commit
language: system
pass_filenames: false
stages: [pre-commit]
# Requires VERIFLOW_API_KEY and VERIFLOW_REPO (owner/repo) on
# the developer's PATH. Branch defaults to "main" if
# VERIFLOW_BRANCH is unset.