it("includes both agent and agents in core CLI command names", () => { const names = getCoreCliCommandNames();
expect(names).toContain("mcp");
expect(names).toContain("agent");
expect(names).toContain("agents");
});
it("returns only commands that support subcommands", () => { const names = getCoreCliCommandsWithSubcommands();
expect(names).toContain("config");
expect(names).toContain("agents");
expect(names).toContain("backup");
expect(names).toContain("mcp");
expect(names).toContain("sessions");
expect(names).toContain("tasks");
expect(names).not.toContain("agent");
expect(names).not.toContain("status");
expect(names).not.toContain("doctor");
});
it("registerCoreCliByName resolves agents to the agent entry", async () => { const program = createProgram(); const found = await registerCoreCliByName(program, testProgramContext, "agents");
expect(found).toBe(true); const agentsCmd = program.commands.find((c) => c.name() === "agents");
expect(agentsCmd).toBeDefined(); // The registrar also installs the singular "agent" command from the same entry. const agentCmd = program.commands.find((c) => c.name() === "agent");
expect(agentCmd).toBeDefined();
});
it("registerCoreCliByName returns false for unknown commands", async () => { const program = createProgram(); const found = await registerCoreCliByName(program, testProgramContext, "nonexistent");
expect(found).toBe(false);
});
it("registers doctor placeholder for doctor primary command", () => { const program = createProgram();
registerCoreCliCommands(program, testProgramContext, ["node", "openclaw", "doctor"]);
expect(namesOf(program)).toEqual(["doctor"]);
});
it("narrows to the primary command when command help is requested", () => { const program = createProgram();
registerCoreCliCommands(program, testProgramContext, ["node", "openclaw", "doctor", "--help"]);
expect(namesOf(program)).toEqual(["doctor"]);
});
it("keeps all placeholders for root help", () => { const program = createProgram();
registerCoreCliCommands(program, testProgramContext, ["node", "openclaw", "--help"]);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.