Skip to main content
Documentation
Guide · Current manual utility

Manual local hooks

Install, inspect, and explicitly run local scripts; normal Dits operations do not invoke them automatically.

Command surface

dits hooks <ACTION> [HOOK] [--force] [-- <ARGS>...]
ActionCurrent behavior
listList recognized hook names and whether a file is installed
install <HOOK>Write a sample into .dits/hooks, marking it executable on Unix; --force may overwrite
uninstall <HOOK>Remove the named local hook file
show <HOOK>Print the installed file, or the built-in sample if absent
run <HOOK> [-- <ARGS>...]Execute one installed hook manually and propagate failure
dits hooks list
dits hooks install pre-commit
dits hooks show pre-commit

# Arguments after -- are passed to the executable
dits hooks run pre-commit -- --check

dits hooks uninstall pre-commit

Recognized names

pre-commitprepare-commit-msgcommit-msgpost-commitpre-pushpost-mergepre-checkoutpost-checkoutpre-rebasepost-rebasepre-auto-gcpost-rewrite

Names describe intended events, but they do not imply automatic lifecycle integration or a stable argument/stdin contract. The manual CLI runner does not supply stdin.

Execution boundary

Installed scripts live at .dits/hooks/<name>. Manual run executes the file from the repository root, sets DITS_DIR and DITS_HOOK, captures stdout/stderr, and returns nonzero when the script fails.

See local file commands and the disabled remote boundary.