feat: improve agents cli automation

This commit is contained in:
Peter Steinberger
2026-01-08 07:49:07 +01:00
parent 5565dcd447
commit 629eec11cc
8 changed files with 198 additions and 19 deletions

View File

@@ -55,4 +55,20 @@ describe("agents add command", () => {
expect(runtime.exit).toHaveBeenCalledWith(1);
expect(configMocks.writeConfigFile).not.toHaveBeenCalled();
});
it("requires --workspace in non-interactive mode", async () => {
configMocks.readConfigFileSnapshot.mockResolvedValue({ ...baseSnapshot });
await agentsAddCommand(
{ name: "Work", nonInteractive: true },
runtime,
{ hasFlags: false },
);
expect(runtime.error).toHaveBeenCalledWith(
expect.stringContaining("--workspace"),
);
expect(runtime.exit).toHaveBeenCalledWith(1);
expect(configMocks.writeConfigFile).not.toHaveBeenCalled();
});
});