feat(cli): move provider login/logout

This commit is contained in:
Peter Steinberger
2026-01-08 07:40:08 +01:00
parent 903f5af59c
commit e83c6ac088
19 changed files with 153 additions and 68 deletions

View File

@@ -1611,7 +1611,7 @@ export async function monitorWebProvider(
if (loggedOut) {
runtime.error(
"WhatsApp session logged out. Run `clawdbot login --provider web` to relink.",
"WhatsApp session logged out. Run `clawdbot providers login --provider web` to relink.",
);
await closeListener();
break;

View File

@@ -70,7 +70,7 @@ export async function loginWeb(
});
console.error(
danger(
"WhatsApp reported the session is logged out. Cleared cached web session; please rerun clawdbot login and scan the QR again.",
"WhatsApp reported the session is logged out. Cleared cached web session; please rerun clawdbot providers login and scan the QR again.",
),
);
throw new Error("Session logged out; cache cleared. Re-run login.");

View File

@@ -169,7 +169,9 @@ export async function createWaSocket(
const status = getStatusCode(lastDisconnect?.error);
if (status === DisconnectReason.loggedOut) {
console.error(
danger("WhatsApp session logged out. Run: clawdbot login"),
danger(
"WhatsApp session logged out. Run: clawdbot providers login",
),
);
}
}
@@ -454,7 +456,7 @@ export async function pickProvider(
const hasWeb = await webAuthExists(authDir);
if (!hasWeb) {
throw new Error(
"No WhatsApp Web session found. Run `clawdbot login --verbose` to link.",
"No WhatsApp Web session found. Run `clawdbot providers login --verbose` to link.",
);
}
return choice;