feat(cli): unify hook pack installs under plugins

This commit is contained in:
Peter Steinberger
2026-03-22 11:19:07 -07:00
parent b44152fcc8
commit aa80b1eb7c
8 changed files with 740 additions and 400 deletions

View File

@@ -2,7 +2,7 @@
summary: "CLI reference for `openclaw hooks` (agent hooks)"
read_when:
- You want to manage agent hooks
- You want to install or update hooks
- You want to inspect hook availability or enable workspace hooks
title: "hooks"
---
@@ -186,14 +186,17 @@ openclaw hooks disable command-logger
- Restart the gateway so hooks reload
## Install Hooks
## Install Hook Packs
```bash
openclaw hooks install <path-or-spec>
openclaw hooks install <npm-spec> --pin
openclaw plugins install <path-or-spec>
openclaw plugins install <npm-spec> --pin
```
Install a hook pack from a local folder/archive or npm.
Install hook packs through the unified plugins installer.
`openclaw hooks install` still works as a compatibility alias, but it prints a
deprecation warning and forwards to `openclaw plugins install`.
Npm specs are **registry-only** (package name + optional **exact version** or
**dist-tag**). Git/URL/file specs and semver ranges are rejected. Dependency
@@ -220,29 +223,32 @@ prerelease tag such as `@beta`/`@rc` or an exact prerelease version.
```bash
# Local directory
openclaw hooks install ./my-hook-pack
openclaw plugins install ./my-hook-pack
# Local archive
openclaw hooks install ./my-hook-pack.zip
openclaw plugins install ./my-hook-pack.zip
# NPM package
openclaw hooks install @openclaw/my-hook-pack
openclaw plugins install @openclaw/my-hook-pack
# Link a local directory without copying
openclaw hooks install -l ./my-hook-pack
openclaw plugins install -l ./my-hook-pack
```
Linked hook packs are treated as managed hooks from an operator-configured
directory, not as workspace hooks.
## Update Hooks
## Update Hook Packs
```bash
openclaw hooks update <id>
openclaw hooks update --all
openclaw plugins update <id>
openclaw plugins update --all
```
Update installed hook packs (npm installs only).
Update tracked npm-based hook packs through the unified plugins updater.
`openclaw hooks update` still works as a compatibility alias, but it prints a
deprecation warning and forwards to `openclaw plugins update`.
**Options:**

View File

@@ -8,7 +8,7 @@ title: "plugins"
# `openclaw plugins`
Manage Gateway plugins/extensions and compatible bundles.
Manage Gateway plugins/extensions, hook packs, and compatible bundles.
Related:
@@ -55,6 +55,10 @@ openclaw plugins install <plugin> --marketplace <marketplace>
Security note: treat plugin installs like running code. Prefer pinned versions.
`plugins install` is also the install surface for hook packs that expose
`openclaw.hooks` in `package.json`. Use `openclaw hooks` for filtered hook
visibility and per-hook enablement, not package installation.
Npm specs are **registry-only** (package name + optional **exact version** or
**dist-tag**). Git/URL/file specs and semver ranges are rejected. Dependency
installs run with `--ignore-scripts` for safety.
@@ -164,8 +168,8 @@ openclaw plugins update <id-or-npm-spec> --dry-run
openclaw plugins update @openclaw/voice-call@beta
```
Updates apply to tracked installs in `plugins.installs`, including npm,
ClawHub, and marketplace installs.
Updates apply to tracked installs in `plugins.installs` and tracked hook-pack
installs in `hooks.internal.installs`.
When you pass a plugin id, OpenClaw reuses the recorded install spec for that
plugin. That means previously stored dist-tags such as `@beta` and exact pinned