CLI Reference¶
GitHooks is built on Laravel Zero. Run githooks list to see all available commands. Every command that reads a configuration file accepts --config=PATH (absolute or relative); every command that produces structured output accepts --format=json and writes a stable JSON v2 schema on stdout.
The commands fall into four groups by purpose.
Execution¶
Run a flow, a combined plan or a single job. These commands honour the execution modes, the thread budget, the time and memory budgets, and the structured-output contracts.
| Command | What it does |
|---|---|
githooks flow <name> |
Run a single flow. |
githooks flows <name1> <name2>… |
Run several flows or a declarative meta-flow as a single combined plan. Replaces the "two CI steps with two composer install" pattern with a single invocation. |
githooks job <name> |
Run a single job in isolation. Useful when iterating on one tool's config. Accepts -- <args> to forward extra arguments to the underlying tool. |
Configuration¶
Generate, validate and upgrade the configuration file.
| Command | What it does |
|---|---|
githooks conf:init |
Generate a githooks.php template, optionally auto-detecting tools under vendor/bin/. Interactive or non-interactive. |
githooks conf:check |
Deep validation: structure, references, paths, executables, configs, deprecations and did-you-mean suggestions. Exits 1 on the first error. The first thing to run when something looks wrong — see Troubleshooting. |
githooks conf:migrate |
One-shot conversion from the legacy v2 Options/Tools shape to the v3 hooks/flows/jobs shape. |
Inspection¶
Look at the system, the install, and the on-disk state without modifying anything.
| Command | What it does |
|---|---|
githooks status |
Show whether hooks are installed for the current repository and which core.hooksPath is active. |
githooks system:info |
Show CPU detection (cgroup-aware) and how processes resolves on the current host. Use to size budgets in CI runners. |
githooks cache:clear |
Clear QA tool cache directories. Resolves the effective cache path per tool (reads .neon / psalm.xml / phpunit.xml / etc.) rather than relying on hard-coded defaults. |
Hook management¶
| Command | What it does |
|---|---|
githooks hook |
Install git hooks via core.hooksPath = .githooks (no overwrite of .git/hooks/). Pre-existing hook scripts are backed up to <hook>.bak. |
Common flags¶
Most flags are shared across flow, flows and job. Rather than repeat them here, see each command page — or Configuration: Options for the canonical reference (the page CLI flags override).