Documentation
CLICommands

ox hooks

Manage event hooks triggered by daemon events such as session uploads, murmurs, and sync completions. Event hooks let you run custom commands when things happen in SageOx.

Usage

terminal
# List registered event hooks
$
# Register a new event hook
$
# Fire a synthetic event to test hooks
$
# Show how to view hook execution logs
$

Subcommands

ox hooks list

List all event hooks registered in hooks.yaml. Add --json for JSON output.

terminal
$

ox hooks add

Register a hook command to run when a daemon event fires.

terminal
$

Events:

SourceEvents
Agentagent.idle, agent.registered
Daemondaemon.started, daemon.stopped
Murmurmurmur.critical, murmur.received
Sessionsession.available, session.started, session.stopped, session.uploaded
Syncsync.completed, sync.failed
All* matches every event

Example:

terminal
# Desktop notification when a murmur arrives
$
# Post each uploaded session event to a webhook
$
# Log every event
$

ox hooks test

Fire a synthetic event through the hook runner to verify your hooks. The event goes to all matching hooks with a test payload, and results print after about 700ms.

terminal
$
$

ox hooks log

Show how to view daemon hook execution logs.

terminal
$

Git hooks

SageOx also installs git hooks. These are managed separately from event hooks, and they run these ox hooks commands:

CommandPurpose
ox hooks commit-msgAppend configured commit trailers
ox hooks post-commitRun post-commit actions
ox hooks post-rewriteKeep recorded commit SHAs current after a rebase
ox hooks pre-pushRecord PR/issue linkage on push

Git hooks are installed automatically by ox integrate install and ox init.

To check git hook status:

terminal
$

Hook execution

  • Hooks run asynchronously; they don't block the daemon
  • Each hook receives the event as JSON on stdin
  • Each hook has a 500ms timeout
  • Hook execution is logged to the daemon log
  • Failed hooks don't affect other hooks or daemon operation

What's next