mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 21:07:01 -06:00
fix(cli): forward agent name through setup (#124740)
Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
committed by
GitHub
parent
5168b5d4ab
commit
a2067ed1bb
@@ -522,6 +522,30 @@ describe("registerSetupCommand", () => {
|
||||
expect(setupCommandMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it.each([
|
||||
["guided", ["--wizard"]],
|
||||
["classic", ["--classic"]],
|
||||
["non-interactive", ["--non-interactive", "--accept-risk"]],
|
||||
])("forwards --agent-name through %s setup", async (_mode, modeArgs) => {
|
||||
await runCli([
|
||||
"setup",
|
||||
...modeArgs,
|
||||
"--agent-name",
|
||||
"robby",
|
||||
"--workspace",
|
||||
"/tmp/robby",
|
||||
"--skip-bootstrap",
|
||||
]);
|
||||
|
||||
expect(lastWizardOptions()).toMatchObject({
|
||||
agentName: "robby",
|
||||
workspace: "/tmp/robby",
|
||||
skipBootstrap: true,
|
||||
});
|
||||
expect(setupCommandMock).not.toHaveBeenCalled();
|
||||
expect(runSystemAgentMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("runs setup wizard command for migration import flags", async () => {
|
||||
await runCli([
|
||||
"setup",
|
||||
|
||||
@@ -139,6 +139,7 @@ async function runOnboardingEntry(
|
||||
await setupWizardCommand(
|
||||
{
|
||||
workspace: readStringValue(options.workspace),
|
||||
agentName: readStringValue(options.agentName),
|
||||
nonInteractive: Boolean(options.nonInteractive),
|
||||
acceptRisk: Boolean(options.acceptRisk),
|
||||
classic: Boolean(options.classic),
|
||||
@@ -206,6 +207,7 @@ export function registerSetupCommand(program: Command): void {
|
||||
"--workspace <dir>",
|
||||
"Workspace proposal for guided setup; persisted by baseline/classic/non-interactive setup",
|
||||
)
|
||||
.option("--agent-name <name>", "Name for the first agent (default: main)")
|
||||
.option("--wizard", "Run interactive onboarding", false)
|
||||
.option(
|
||||
"--baseline",
|
||||
|
||||
Reference in New Issue
Block a user