Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
openclaw hooksManage agent hooks (event-driven automations for commands like
/new/resetRunning
openclaw hooksopenclaw hooks listRelated:
bashopenclaw hooks list
List all discovered hooks from workspace, managed, extra, and bundled directories. Gateway startup does not load internal hook handlers until at least one internal hook is configured.
Options:
--eligible--json-v, --verboseExample output:
textHooks (4/4 ready) Ready: 🚀 boot-md ✓ - Run BOOT.md on gateway startup 📎 bootstrap-extra-files ✓ - Inject extra workspace bootstrap files during agent bootstrap 📝 command-logger ✓ - Log all command events to a centralized audit file 💾 session-memory ✓ - Save session context to memory when /new or /reset command is issued
Example (verbose):
bashopenclaw hooks list --verbose
Shows missing requirements for ineligible hooks.
Example (JSON):
bashopenclaw hooks list --json
Returns structured JSON for programmatic use.
bashopenclaw hooks info <name>
Show detailed information about a specific hook.
Arguments:
<name>session-memoryOptions:
--jsonExample:
bashopenclaw hooks info session-memory
Output:
text💾 session-memory ✓ Ready Save session context to memory when /new or /reset 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/automation/hooks#session-memory Events: command:new, command:reset Requirements: Config: ✓ workspace.dir
bashopenclaw hooks check
Show summary of hook eligibility status (how many are ready vs. not ready).
Options:
--jsonExample output:
textHooks Status Total hooks: 4 Ready: 4 Not ready: 0
bashopenclaw hooks enable <name>
Enable a specific hook by adding it to your config (
~/.openclaw/openclaw.jsonNote: Workspace hooks are disabled by default until enabled here or in config. Hooks managed by plugins show
plugin:<id>openclaw hooks listArguments:
<name>session-memoryExample:
bashopenclaw hooks enable session-memory
Output:
text✓ Enabled hook: 💾 session-memory
What it does:
hooks.internal.entries.<name>.enabled = trueIf the hook came from
<workspace>/hooks/After enabling:
bashopenclaw hooks disable <name>
Disable a specific hook by updating your config.
Arguments:
<name>command-loggerExample:
bashopenclaw hooks disable command-logger
Output:
text⏸ Disabled hook: 📝 command-logger
After disabling:
openclaw hooks list --jsoninfo --jsoncheck --jsonbashopenclaw plugins install <package> # ClawHub first, then npm openclaw plugins install npm:<package> # npm only openclaw plugins install <package> --pin # pin version openclaw plugins install <path> # local path
Install hook packs through the unified plugins installer.
openclaw hooks installopenclaw plugins installNpm specs are registry-only (package name + optional exact version or dist-tag). Git/URL/file specs and semver ranges are rejected. Dependency installs run project-local with
--ignore-scriptsBare specs and
@latest@beta@rcWhat it does:
~/.openclaw/hooks/<id>hooks.internal.entries.*hooks.internal.installsOptions:
-l, --linkhooks.internal.load.extraDirs--pinname@versionhooks.internal.installsSupported archives:
.zip.tgz.tar.gz.tarExamples:
bash# Local directory openclaw plugins install ./my-hook-pack # Local archive openclaw plugins install ./my-hook-pack.zip # NPM package openclaw plugins install @openclaw/my-hook-pack # Link a local directory without copying openclaw plugins install -l ./my-hook-pack
Linked hook packs are treated as managed hooks from an operator-configured directory, not as workspace hooks.
bashopenclaw plugins update <id> openclaw plugins update --all
Update tracked npm-based hook packs through the unified plugins updater.
openclaw hooks updateopenclaw plugins updateOptions:
--all--dry-runWhen a stored integrity hash exists and the fetched artifact hash changes, OpenClaw prints a warning and asks for confirmation before proceeding. Use global
--yesSaves session context to memory when you issue
/new/resetEnable:
bashopenclaw hooks enable session-memory
Output:
~/.openclaw/workspace/memory/YYYY-MM-DD-slug.mdSee: session-memory documentation
Injects additional bootstrap files (for example monorepo-local
AGENTS.mdTOOLS.mdagent:bootstrapEnable:
bashopenclaw hooks enable bootstrap-extra-files
See: bootstrap-extra-files documentation
Logs all command events to a centralized audit file.
Enable:
bashopenclaw hooks enable command-logger
Output:
~/.openclaw/logs/commands.logView logs:
bash# Recent commands tail -n 20 ~/.openclaw/logs/commands.log # Pretty-print cat ~/.openclaw/logs/commands.log | jq . # Filter by action grep '"action":"new"' ~/.openclaw/logs/commands.log | jq .
See: command-logger documentation
Runs
BOOT.mdEvents:
gateway:startupEnable:
bashopenclaw hooks enable boot-md
© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine