Skip to content

Commit 8090ae9

Browse files
committed
1 parent ffa0929 commit 8090ae9

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

‎src/cli/program/register.setup.test.ts‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,30 @@ describe("registerSetupCommand", () => {
522522
expect(setupCommandMock).not.toHaveBeenCalled();
523523
});
524524

525+
it.each([
526+
["guided", ["--wizard"]],
527+
["classic", ["--classic"]],
528+
["non-interactive", ["--non-interactive", "--accept-risk"]],
529+
])("forwards --agent-name through %s setup", async (_mode, modeArgs) => {
530+
await runCli([
531+
"setup",
532+
...modeArgs,
533+
"--agent-name",
534+
"robby",
535+
"--workspace",
536+
"/tmp/robby",
537+
"--skip-bootstrap",
538+
]);
539+
540+
expect(lastWizardOptions()).toMatchObject({
541+
agentName: "robby",
542+
workspace: "/tmp/robby",
543+
skipBootstrap: true,
544+
});
545+
expect(setupCommandMock).not.toHaveBeenCalled();
546+
expect(runSystemAgentMock).not.toHaveBeenCalled();
547+
});
548+
525549
it("runs setup wizard command for migration import flags", async () => {
526550
await runCli([
527551
"setup",

‎src/cli/program/register.setup.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ async function runOnboardingEntry(
139139
await setupWizardCommand(
140140
{
141141
workspace: readStringValue(options.workspace),
142+
agentName: readStringValue(options.agentName),
142143
nonInteractive: Boolean(options.nonInteractive),
143144
acceptRisk: Boolean(options.acceptRisk),
144145
classic: Boolean(options.classic),
@@ -206,6 +207,7 @@ export function registerSetupCommand(program: Command): void {
206207
"--workspace <dir>",
207208
"Workspace proposal for guided setup; persisted by baseline/classic/non-interactive setup",
208209
)
210+
.option("--agent-name <name>", "Name for the first agent (default: main)")
209211
.option("--wizard", "Run interactive onboarding", false)
210212
.option(
211213
"--baseline",

0 commit comments

Comments
 (0)