mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 17:50:22 +00:00
Plugins/CLI: add descriptor-backed lazy root command registration (#57165)
Merged via squash.
Prepared head SHA: ad1dee32eb
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
committed by
GitHub
parent
d330782ed1
commit
9b4f26e70a
@@ -1603,6 +1603,14 @@ export type OpenClawPluginCliContext = {
|
||||
|
||||
export type OpenClawPluginCliRegistrar = (ctx: OpenClawPluginCliContext) => void | Promise<void>;
|
||||
|
||||
/**
|
||||
* Top-level CLI metadata for plugin-owned commands.
|
||||
*
|
||||
* Descriptors are the parse-time contract for lazy plugin CLI registration.
|
||||
* If you want OpenClaw to keep a plugin command lazy-loaded while still
|
||||
* advertising it at the root CLI level, provide descriptors that cover every
|
||||
* top-level command root registered by that plugin CLI surface.
|
||||
*/
|
||||
export type OpenClawPluginCliCommandDescriptor = {
|
||||
name: string;
|
||||
description: string;
|
||||
@@ -1707,7 +1715,15 @@ export type OpenClawPluginApi = {
|
||||
registerCli: (
|
||||
registrar: OpenClawPluginCliRegistrar,
|
||||
opts?: {
|
||||
/** Explicit top-level command roots owned by this registrar. */
|
||||
commands?: string[];
|
||||
/**
|
||||
* Parse-time command descriptors for lazy root CLI registration.
|
||||
*
|
||||
* When descriptors cover every top-level command root, OpenClaw can keep
|
||||
* the plugin registrar lazy in the normal root CLI path. Command-only
|
||||
* registrations stay on the eager compatibility path.
|
||||
*/
|
||||
descriptors?: OpenClawPluginCliCommandDescriptor[];
|
||||
},
|
||||
) => void;
|
||||
|
||||
Reference in New Issue
Block a user