mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 12:56:01 -06:00
feat: add one-paste node onboarding (#122499)
* feat(pairing): add short join onboarding * fix(gateway): isolate device join routing tests
This commit is contained in:
committed by
GitHub
parent
fb9a62e995
commit
ade3456dd4
@@ -942,6 +942,30 @@ export async function runDevicesListCommand(opts: DevicesRpcOpts): Promise<void>
|
||||
}
|
||||
}
|
||||
|
||||
export async function runDevicesJoinCodeCommand(opts: DevicesRpcOpts): Promise<void> {
|
||||
const result = await callGatewayCli(
|
||||
"device.pair.setupCode",
|
||||
opts,
|
||||
{
|
||||
bootstrapProfile: "node",
|
||||
includeQr: false,
|
||||
joinUrl: true,
|
||||
},
|
||||
{ scopes: [ADMIN_SCOPE] },
|
||||
);
|
||||
const joinUrl = normalizeOptionalString((result as { joinUrl?: unknown }).joinUrl);
|
||||
if (!joinUrl) {
|
||||
throw new Error("Gateway did not return a device join URL.");
|
||||
}
|
||||
const command = `npx openclaw connect ${quoteCliArg(joinUrl)}`;
|
||||
if (opts.json) {
|
||||
defaultRuntime.writeJson({ joinUrl, command });
|
||||
return;
|
||||
}
|
||||
defaultRuntime.log(joinUrl);
|
||||
defaultRuntime.log(command);
|
||||
}
|
||||
|
||||
export async function runDevicesRemoveCommand(
|
||||
deviceId: string,
|
||||
opts: DevicesRpcOpts,
|
||||
|
||||
Reference in New Issue
Block a user