confirm
uses @clack/prompts's exports, which uses node:fs
Yes or no; without a terminal, the answer is no.
import { answer, interactive } from "#codebase/tcmts/cli/ui"; import * as p from "@clack/prompts"; export async function confirm(message: string): Promise<boolean> { if (!interactive()) return false; return answer<boolean>(await p.confirm({ message, initialValue: false })); }