MCPcopy
hub / github.com/MiniMax-AI/cli / promptConfirm

Function promptConfirm

src/utils/prompt.ts:48–60  ·  view source on GitHub ↗
(options: {
  message: string;
})

Source from the content-addressed store, hash-verified

46 * Like promptText but confirms with y/N before proceeding.
47 */
48export async function promptConfirm(options: {
49 message: string;
50}): Promise<boolean | undefined> {
51 if (!isInteractive()) return undefined;
52
53 const { message } = options;
54 const inquirer = await import('@clack/prompts');
55 // eslint-disable-next-line @typescript-eslint/no-explicit-any
56 const val = await (inquirer as any).confirm({ message });
57
58 if (typeof val === 'symbol') return undefined;
59 return val as boolean;
60}
61
62/**
63 * Fail fast with a user-friendly error when a required option is missing

Callers 1

ensureAuthFunction · 0.90

Calls 1

isInteractiveFunction · 0.85

Tested by

no test coverage detected