UNPKG

@vigilbase/cli

Version:

Vigilbase CLI — security scanners, agent tools, and Vigilbase One from the terminal.

32 lines (31 loc) • 1.57 kB
/** One piped answer is at most this long (an email address is at most 254 bytes). */ export declare const MAX_ANSWER_BYTES = 256; export type PromptIO = { stdin?: NodeJS.ReadableStream; stderr: NodeJS.WritableStream; }; export declare function hasInteractiveInput(stdin: NodeJS.ReadableStream | undefined): boolean; /** * A visible one-line prompt on a TTY (account picker, confirmations): the * trimmed answer, or null when the input ended (Ctrl-D) before one. */ export declare function promptLine(io: PromptIO, label: string): Promise<string | null>; /** * One line of piped input, without consuming the next one: whatever follows * the newline is pushed back onto the stream for the next prompt. Bytes past * `MAX_ANSWER_BYTES` are dropped up to the newline, so an overlong line comes * back too long and fails validation. Null at the end of the input. */ export declare function readPipedLine(stdin: NodeJS.ReadableStream): Promise<string | null>; /** * A visible prompt for the email verification. On a terminal it is * `promptLine`; without one the label still goes to stderr and the answer is * one line of piped stdin. Null when the input ended without an answer. */ export declare function promptAnswer(io: PromptIO, label: string): Promise<string | null>; /** * `[Y/n]` question where Enter means yes (installing cf). The caller handles * `--yes` and the no-terminal case; an input that ends before an answer is * CONFIRMATION_REQUIRED. */ export declare function confirmDefaultYes(io: PromptIO, question: string): Promise<boolean>;