Command
okulo hook
Install or remove a Git pre-commit hook that runs okulo check --staged.
localdx
When to use it
You want the quality gate on every commit without remembering to run check.
Usage
okulo hook install|uninstall [repo] [options]
Options
| Option | Default | Description |
|---|---|---|
--fail-on | critical | Severity forwarded to okulo check |
--components A,B | all | Scope the staged check |
--force | off | Overwrite a non-okulo pre-commit hook |
Examples
Default install
okulo hook install
okulo hook uninstall Stricter, scoped hook
okulo hook install --fail-on warning --components backend
Sample output
Illustrative terminal output (column layout matches the real CLI):
$ okulo hook install
okulo: installed pre-commit hook → .git/hooks/pre-commit
runs: okulo check --staged
$ git commit -m "wip"
Change check staged vs HEAD
…
FAIL 1 critical · 0 warnings
okulo: pre-commit check failed (exit 1)
How to read it
- Install only rewrites an Okulo-managed hook (unless
--force). - On commit, a FAIL blocks creating the commit — same rules as
okulo check --staged. - Still keep CI
okulo check; the hook is a fast local safety net, not the only gate.
Tips
- Without
--force, Okulo will not replace a pre-commit hook it did not write. - In shared repos, prefer CI
okulo checkeven if locals use the hook.