#custom extension handling?

1 messages · Page 1 of 1 (latest)

echo nova
#

I added a custom extension to the .npmGlobal/../extensions folder under openclaw, though everytime I update openclaw, the custom extension folder will be removed. How should I handle this?

high gorgeBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

hushed valleyBOT
#

Don’t put custom stuff under the global npm install (…/.npm-global/.../node_modules/openclaw/...) — npm i -g openclaw@… will reinstall that folder and wipe any edits.

Use the plugin/extension loader paths that live outside the install:

  • Workspace extensions: <workspace>/.openclaw/extensions/...
  • Global extensions: ~/.openclaw/extensions/...
  • Or anywhere you want via plugins.load.paths

The easiest workflow is:

  1. Keep your plugin in its own folder (git repo is ideal) with an openclaw.plugin.json manifest
  2. Install it into the persistent OpenClaw state dir:
openclaw plugins install -l /path/to/your-plugin # dev (symlink)
# or
#
openclaw plugins install /path/to/your-plugin # copy into ~/.openclaw/extensions/<id>
  1. Enable it + restart the gateway (plugin config changes require restart):
openclaw plugins enable <id>
openclaw gateway restart

Docs (paths + commands): https://docs.openclaw.ai/tools/plugin

echo nova
#

the extension currently lives in .npm-global.../openclaw/..., and I have enabled it in openclaw.json. How should I proceed to change it to a global extension?

hushed valleyBOT
#

If it’s currently living under the npm global install (…/.npm-global/.../node_modules/openclaw/...), the fix is basically: move it out into $OPENCLAW_STATE_DIR/extensions (defaults to ~/.openclaw/extensions) so updates don’t touch it.

Recommended way (uses the plugin installer)

  1. Copy your plugin/extension folder somewhere stable (outside node_modules), e.g.
    ~/openclaw-plugins/<your-plugin> (just a normal directory you control).

  2. Install it into the global extensions dir:

openclaw plugins install -l ~/openclaw-plugins/<your-plugin> # symlink for dev
# or (if you want a frozen copy under ~/.openclaw/extensions/<id>/)
openclaw plugins install ~/openclaw-plugins/<your-plugin>
  1. Restart the gateway (plugin discovery/config needs restart):
#
openclaw gateway restart
  1. Verify it’s being picked up from the global dir:
openclaw plugins list
openclaw plugins info <id>

Config impact

  • If your openclaw.json already has plugins.entries.<id>.enabled: true, you can usually keep it unchanged — just make sure the plugin id stays the same after you move it.
  • If you have plugins.allow, ensure it includes the id (otherwise it won’t load).

Docs for the exact discovery paths + precedence: https://docs.openclaw.ai/tools/plugin

hushed valleyBOT
#

Those warnings make sense given your history (plugin living in node_modules/openclaw/extensions/... before):

1) plugins.allow is empty…

That’s just a security heads‑up: if you leave plugins.allow empty, OpenClaw will load any discoverable non-bundled plugins (workspace/global/load.paths).

  • Safe to ignore for a personal setup.
  • If you do set plugins.allow, be aware it becomes a real allowlist (“only these plugins may load”), so you must include everything you rely on. Easiest way is to first inspect what’s loading:
openclaw plugins list

…and only then decide whether you want an allowlist.

2) duplicate plugin id detected … (/.../node_modules/openclaw/extensions/memory-hybrid/...)

You currently have two copies with the same plugin id: