/** * CLI context module - consolidated global state for CLI operations. * * Creates a CliContext object from argv and environment, providing: * - Output configuration (format, color, verbosity) * - TTY detection * - Color functions that respect color settings * - Prefixes for different message types * * @example * ```ts * import { createContext } from './cli/context.js'; * * const ctx = createContext(process.argv.slice(2), process.env); * console.log(ctx.colors.green('Success!')); * ``` */ import type { OutputFormat } from "../types/index.js"; export type OutputConfig = { format: OutputFormat | undefined; color: boolean; verbose: boolean; debug: boolean; quiet: boolean; }; export type CliContext = { isTty: boolean; output: OutputConfig; colors: { bold: (t: string) => string; dim: (t: string) => string; cyan: (t: string) => string; yellow: (t: string) => string; green: (t: string) => string; red: (t: string) => string; }; prefix: { ok: string; warn: string; err: string; info: string; }; }; /** * Create CLI context from argv and environment. * * @param argv - Command line arguments (without node/script path) * @param env - Environment variables * @param isTty - Whether stdout is a TTY (passed explicitly for testability) */ export declare function createContext(argv: string[], env: Record, isTty?: boolean): CliContext; //# sourceMappingURL=context.d.ts.map