CLI Commands Reference
UltraHooks utilizes a simple, straightforward CLI mapped intuitively to your workflow.
ultrahooks init
Description: Initializes the UltraHooks context in your current Git repository. Behavior:
- Triggers an interactive CLI prompt using
survey. - Asks:
"What languages does your project use? [Go, Node.js, Python, Rust, Other]" - Scaffolds the
.ultrahooks/directory. - Drops a standard
.ultrahooks/pre-commit.shshell script template. - Dynamically populates
.ultrahooks/config.yamlwith commands matching your selected languages (e.g.npm run lint,go fmt).
ultrahooks add <hookName...>
Description: Easily scaffolds new template files for specific Git hooks and simultaneously wires them up. Behavior:
- Generates
.ultrahooks/<hookName>.shand applieschmod +x. - Immediately installs the Git proxy script into
.git/hooks/<hookName>. - Multi-argument friendly.
- Integrates shell auto-completion for Git standard hook names to prevent typos!
Example:
bash
ultrahooks add pre-commit pre-pushultrahooks install
Description: Synchronizes your .git/hooks/ folder to match your active UltraHooks configuration. Behavior:
- Reads your
.ultrahooks/config.yamland scans the.ultrahooks/directory. - For every active hook discovered, it writes a proxy execution script into
.git/hooks/. - Note: It does not blindly install all 28 Git hooks. It is precise and surgical, only installing exactly what you are using.
ultrahooks run <hookName>
Description: Executes the logic for a specific hook. (This is primarily what the Git proxy scripts call). Behavior:
- Loads
config.yamlmap for<hookName>. - Auto-discovers any shell scripts (
.sh,.bat,.ps1) in the.ultrahooks/directory matching the name and prepends them. - Executes them sequentially (or concurrently if
parallel: trueis set).
ultrahooks remove [hookName...] [--all]
Description: Cleanly unwires your Git hooks and deletes scaffolding. Behavior:
- Specific Removal:
ultrahooks remove pre-commitwill unwire.git/hooks/pre-commitand delete.ultrahooks/pre-commit.sh, leavingpre-pushperfectly intact. - Global Wipe:
ultrahooks remove --allscans.git/hooks/and finds any proxy script managed by UltraHooks, deleting them. It then completely wipes all recognized shell scripts in your.ultrahooks/directory.
ultrahooks doctor
Description: A health-check diagnostic scanner. Behavior:
- Checks if you are in a Git repository.
- Validates the syntactical health of
.ultrahooks/config.yaml. - Analyzes custom script permissions (
chmod +xexecutable bit). - Verifies that proxy links inside
.git/hooks/actually exist for the hooks you have defined.
