fix(plugins): label registry list state as enabled

This commit is contained in:
Vincent Koc
2026-04-25 05:22:15 -07:00
parent 5677a26385
commit feb8d3a4bd
3 changed files with 20 additions and 15 deletions

View File

@@ -179,9 +179,7 @@ export function registerPluginsCli(program: Command) {
config: cfg,
...(opts.json ? { logger: quietPluginJsonLogger } : {}),
});
const list = opts.enabled
? report.plugins.filter((p) => p.status === "loaded")
: report.plugins;
const list = opts.enabled ? report.plugins.filter((p) => p.enabled) : report.plugins;
if (opts.json) {
const payload = {
@@ -202,9 +200,9 @@ export function registerPluginsCli(program: Command) {
return;
}
const loaded = list.filter((p) => p.status === "loaded").length;
const enabled = list.filter((p) => p.enabled).length;
defaultRuntime.log(
`${theme.heading("Plugins")} ${theme.muted(`(${loaded}/${list.length} loaded)`)}`,
`${theme.heading("Plugins")} ${theme.muted(`(${enabled}/${list.length} enabled)`)}`,
);
if (!opts.verbose) {
@@ -225,11 +223,11 @@ export function registerPluginsCli(program: Command) {
ID: plugin.name && plugin.name !== plugin.id ? plugin.id : "",
Format: plugin.format ?? "openclaw",
Status:
plugin.status === "loaded"
? theme.success("loaded")
: plugin.status === "disabled"
? theme.warn("disabled")
: theme.error("error"),
plugin.status === "error"
? theme.error("error")
: plugin.enabled
? theme.success("enabled")
: theme.warn("disabled"),
Source: sourceLine,
Version: plugin.version ?? "",
};