MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / cliConfirm

Function cliConfirm

apps/web/src/scripts/lib/cli-confirm.ts:3–23  ·  view source on GitHub ↗
(message: string)

Source from the content-addressed store, hash-verified

1import { createInterface } from 'readline';
2
3export async function cliConfirm(message: string): Promise<void> {
4 const rl = createInterface({
5 input: process.stdin,
6 output: process.stdout,
7 });
8
9 return new Promise(resolve => {
10 rl.question(`${message} (y/N): `, answer => {
11 rl.close();
12
13 const response = answer.trim().toLowerCase();
14
15 if (response === 'y' || response === 'yes') {
16 resolve();
17 } else {
18 console.log("Exiting because you didn't confirm");
19 process.exit(0);
20 }
21 });
22 });
23}

Callers 5

runFunction · 0.90
runFunction · 0.90
runFunction · 0.90
runFunction · 0.90
runFunction · 0.90

Calls 3

closeMethod · 0.65
logMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected