Merge pull request #2206 from javexed/feat/setup-other-channel
feat(setup): add "Other…" option to channel picker
This commit is contained in:
@@ -60,7 +60,7 @@ import { isValidTimezone } from '../src/timezone.js';
|
|||||||
const CLI_AGENT_NAME = 'Terminal Agent';
|
const CLI_AGENT_NAME = 'Terminal Agent';
|
||||||
const RUN_START = Date.now();
|
const RUN_START = Date.now();
|
||||||
|
|
||||||
type ChannelChoice = 'telegram' | 'discord' | 'whatsapp' | 'signal' | 'teams' | 'slack' | 'imessage' | 'skip';
|
type ChannelChoice = 'telegram' | 'discord' | 'whatsapp' | 'signal' | 'teams' | 'slack' | 'imessage' | 'other' | 'skip';
|
||||||
|
|
||||||
async function main(): Promise<void> {
|
async function main(): Promise<void> {
|
||||||
// Make sure ~/.local/bin is on PATH for every child process we spawn.
|
// Make sure ~/.local/bin is on PATH for every child process we spawn.
|
||||||
@@ -441,7 +441,7 @@ async function main(): Promise<void> {
|
|||||||
|
|
||||||
if (!skip.has('channel')) {
|
if (!skip.has('channel')) {
|
||||||
channelChoice = await askChannelChoice();
|
channelChoice = await askChannelChoice();
|
||||||
if (channelChoice !== 'skip') {
|
if (channelChoice !== 'skip' && channelChoice !== 'other') {
|
||||||
await resolveDisplayName();
|
await resolveDisplayName();
|
||||||
}
|
}
|
||||||
if (channelChoice === 'telegram') {
|
if (channelChoice === 'telegram') {
|
||||||
@@ -458,6 +458,8 @@ async function main(): Promise<void> {
|
|||||||
await runSlackChannel(displayName!);
|
await runSlackChannel(displayName!);
|
||||||
} else if (channelChoice === 'imessage') {
|
} else if (channelChoice === 'imessage') {
|
||||||
await runIMessageChannel(displayName!);
|
await runIMessageChannel(displayName!);
|
||||||
|
} else if (channelChoice === 'other') {
|
||||||
|
await askOtherChannelName();
|
||||||
} else {
|
} else {
|
||||||
p.log.info(
|
p.log.info(
|
||||||
brandBody(
|
brandBody(
|
||||||
@@ -1076,6 +1078,7 @@ async function askChannelChoice(): Promise<ChannelChoice> {
|
|||||||
hint: 'needs public URL',
|
hint: 'needs public URL',
|
||||||
},
|
},
|
||||||
{ value: 'teams', label: 'Yes, connect Microsoft Teams', hint: 'complex setup' },
|
{ value: 'teams', label: 'Yes, connect Microsoft Teams', hint: 'complex setup' },
|
||||||
|
{ value: 'other', label: 'Other…', hint: 'install via /add-<name> after setup' },
|
||||||
{ value: 'skip', label: 'Skip for now', hint: "I'll just use the terminal" },
|
{ value: 'skip', label: 'Skip for now', hint: "I'll just use the terminal" },
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
@@ -1085,6 +1088,26 @@ async function askChannelChoice(): Promise<ChannelChoice> {
|
|||||||
return choice;
|
return choice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function askOtherChannelName(): Promise<void> {
|
||||||
|
const answer = ensureAnswer(
|
||||||
|
await p.text({
|
||||||
|
message: 'Which channel would you like to install?',
|
||||||
|
placeholder: 'e.g. matrix, github, linear, webex',
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
const name = (answer as string).trim().toLowerCase().replace(/^\/?(add-)?/, '');
|
||||||
|
setupLog.userInput('other_channel', name);
|
||||||
|
phEmit('channel_other_named', { channel: name });
|
||||||
|
p.log.info(
|
||||||
|
brandBody(
|
||||||
|
wrapForGutter(
|
||||||
|
`No bash installer for ${k.bold(name)} — open Claude Code after setup and run ${k.bold(`/add-${name}`)} to install it.`,
|
||||||
|
4,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// ─── interactive / env helpers ─────────────────────────────────────────
|
// ─── interactive / env helpers ─────────────────────────────────────────
|
||||||
|
|
||||||
function ensureLocalBinOnPath(): void {
|
function ensureLocalBinOnPath(): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user