# CLI, cron, and hook validation recipes ## CLI installation ```bash npm install -g # If the only failure is EACCES under /usr/local: npm install -g --prefix "$HOME/.local" which --version auth status --text # read-only; never starts login ``` Do not substitute `sudo npm install` merely to repair a user-writable prefix. ## Script-only cron - Use `no_agent=true` when stdout is the complete delivery. - Empty stdout means silent delivery; do not print an empty-queue informational line. - Hermes script paths must resolve inside `$HERMES_HOME/scripts/`; use a short wrapper filename there when needed. - After creation/update: list the job, run it once, then list/read the latest execution and artifact. ## Hook payload compatibility Claude Code's blocking response: ```json {"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"..."}} ``` Hermes shell hook's blocking response: ```json {"action":"block","message":"..."} ``` A shared guard can emit both. For Hermes, `ask` cannot be represented as an interactive prompt by a shell hook; map it to `block` when the hook is configured fail-closed. After changing a hook script, renew its allowlist approval because Hermes checks the approved script mtime. Run: ```bash hermes hooks list hermes hooks doctor hermes hooks test pre_tool_call --for-tool Bash --payload-file /path/to/payload.json ``` A synthetic test proves the hook parser and script contract, not that a running gateway has reloaded the configuration. Restart the gateway from a separate shell and perform a safe live test afterward. ## Parallel delegation Dispatch independent tasks in one `delegate_task` call with `background` behavior. Do not poll transcripts. The runtime may consolidate sibling completions into one batch; preserve each result under its own label and do not claim message-level arrival ordering.