perf(cli): speed up help/config paths and route config get/unset

This commit is contained in:
Peter Steinberger
2026-02-14 00:27:30 +00:00
parent 386bb0c618
commit 4d1461011d
8 changed files with 223 additions and 59 deletions

View File

@@ -23,4 +23,16 @@ describe("program routes", () => {
it("does not match unknown routes", () => {
expect(findRoutedCommand(["definitely-not-real"])).toBeNull();
});
it("returns false for config get route when path argument is missing", async () => {
const route = findRoutedCommand(["config", "get"]);
expect(route).not.toBeNull();
await expect(route?.run(["node", "openclaw", "config", "get", "--json"])).resolves.toBe(false);
});
it("returns false for config unset route when path argument is missing", async () => {
const route = findRoutedCommand(["config", "unset"]);
expect(route).not.toBeNull();
await expect(route?.run(["node", "openclaw", "config", "unset"])).resolves.toBe(false);
});
});