hooks
openclaw hooks
Section titled “openclaw hooks”管理代理钩子 (针对 /new、/reset 等命令和网关启动的事件驱动自动化)。
相关:
列出所有钩子
Section titled “列出所有钩子”openclaw hooks list列出从工作区、托管和捆绑目录中发现的所有钩子。
选项:
--eligible: 仅显示合格的钩子 (满足要求)--json: 输出为 JSON-v, --verbose: 显示详细信息,包括缺失的要求
示例输出:
Hooks (4/4 ready)
Ready: 🚀 boot-md ✓ - Run BOOT.md on gateway startup 📝 command-logger ✓ - Log all command events to a centralized audit file 💾 session-memory ✓ - Save session context to memory when /new command is issued 😈 soul-evil ✓ - Swap injected SOUL content during a purge window or by random chance示例 (详细):
openclaw hooks list --verbose显示不合格钩子的缺失要求。
示例 (JSON):
openclaw hooks list --json返回用于编程用途的结构化 JSON。
获取钩子信息
Section titled “获取钩子信息”openclaw hooks info <name>显示有关特定钩子的详细信息。
参数:
<name>: 钩子名称 (例如session-memory)
选项:
--json: 输出为 JSON
示例:
openclaw hooks info session-memory输出:
💾 session-memory ✓ Ready
Save session context to memory when /new command is issued
Details: Source: openclaw-bundled Path: /path/to/openclaw/hooks/bundled/session-memory/HOOK.md Handler: /path/to/openclaw/hooks/bundled/session-memory/handler.ts Homepage: https://docs.openclaw.ai/hooks#session-memory Events: command:new
Requirements: Config: ✓ workspace.dir