Skip to content

Commit d5f4e09

Browse files
Fzkujiclaude
andcommitted
feat(tui): /login <channel> shows real connection recipe
/login wechat now prints the QR-login recipe — run "openprogram channels accounts login wechat default" in a second terminal, scan, /attach the wxid here. Same shape for /login telegram|discord|slack with the bot token route. Bare /login points at the right shell paths for both channel auth and provider auth. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 88978b7 commit d5f4e09

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

cli/src/commands/handler.ts

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,42 @@ export function handleSlash(line: string, ctx: SlashContext): boolean {
261261
return true;
262262
}
263263

264+
case 'login': {
265+
const channel = args[0];
266+
if (channel === 'wechat') {
267+
ctx.pushSystem(
268+
'WeChat login (QR scan via your phone):\n' +
269+
' 1. In another terminal, run:\n' +
270+
' openprogram channels accounts login wechat default\n' +
271+
' 2. Scan the printed QR with your phone\'s WeChat app.\n' +
272+
' 3. The channel worker auto-starts after login. Incoming\n' +
273+
' messages from your contacts will route to the default\n' +
274+
' agent (or per /attach binding).\n' +
275+
' 4. Bind a specific contact to this session with:\n' +
276+
' /attach wechat default <wxid>',
277+
);
278+
return true;
279+
}
280+
if (channel === 'telegram' || channel === 'discord' || channel === 'slack') {
281+
ctx.pushSystem(
282+
`${channel} login uses a bot token. In another terminal, run:\n` +
283+
` openprogram channels accounts add ${channel} default\n` +
284+
'and paste the token when prompted.\n' +
285+
'Then use /attach ' + channel + ' default <peer_id> to route a peer here.',
286+
);
287+
return true;
288+
}
289+
ctx.pushSystem(
290+
'Channel login: /login <wechat|telegram|discord|slack>.\n' +
291+
'For provider auth (Anthropic / Codex / Gemini): run\n' +
292+
' openprogram providers login <name> from the shell.',
293+
);
294+
return true;
295+
}
296+
264297
case 'memory':
265298
case 'mcp':
266299
case 'doctor':
267-
case 'login':
268300
case 'logout':
269301
case 'config':
270302
case 'review':

0 commit comments

Comments
 (0)