mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-08 06:54:24 +00:00
fix(cli): load plugin registry for configure and onboard commands (#17266)
(cherry picked from commit 644badd40d)
This commit is contained in:
committed by
Peter Steinberger
parent
792bd6195c
commit
58ce0a89ec
@@ -80,6 +80,8 @@ describe("registerPreActionHooks", () => {
|
||||
program.command("update").action(async () => {});
|
||||
program.command("channels").action(async () => {});
|
||||
program.command("directory").action(async () => {});
|
||||
program.command("configure").action(async () => {});
|
||||
program.command("onboard").action(async () => {});
|
||||
program
|
||||
.command("message")
|
||||
.command("send")
|
||||
@@ -125,6 +127,24 @@ describe("registerPreActionHooks", () => {
|
||||
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("loads plugin registry for configure command", async () => {
|
||||
await runCommand({
|
||||
parseArgv: ["configure"],
|
||||
processArgv: ["node", "openclaw", "configure"],
|
||||
});
|
||||
|
||||
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("loads plugin registry for onboard command", async () => {
|
||||
await runCommand({
|
||||
parseArgv: ["onboard"],
|
||||
processArgv: ["node", "openclaw", "onboard"],
|
||||
});
|
||||
|
||||
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("skips config guard for doctor and completion commands", async () => {
|
||||
await runCommand({
|
||||
parseArgv: ["doctor"],
|
||||
|
||||
@@ -21,7 +21,13 @@ function setProcessTitleForCommand(actionCommand: Command) {
|
||||
}
|
||||
|
||||
// Commands that need channel plugins loaded
|
||||
const PLUGIN_REQUIRED_COMMANDS = new Set(["message", "channels", "directory"]);
|
||||
const PLUGIN_REQUIRED_COMMANDS = new Set([
|
||||
"message",
|
||||
"channels",
|
||||
"directory",
|
||||
"configure",
|
||||
"onboard",
|
||||
]);
|
||||
|
||||
function getRootCommand(command: Command): Command {
|
||||
let current = command;
|
||||
|
||||
Reference in New Issue
Block a user