export interface CliFlags { transport?: "stdio" | "http" | "both"; port?: number; host?: string; config?: string; help?: boolean; version?: boolean; } export interface CliParseResult { /** Parsed flags. Empty object for `--help`/`--version` callers + empty argv. */ flags: CliFlags; /** * True when `--help` was passed. Caller should print usage + exit(0). * Checked separately from parse errors so `--help` works even alongside * invalid flags (common operator habit: "what do I pass here?"). */ help: boolean; /** True when `--version` was passed. Caller prints version + exits(0). */ version: boolean; /** Usage error message + exit code. Null when parse succeeded. */ error: { message: string; exitCode: number; } | null; } /** * Parse `process.argv.slice(2)` style input. Accepts both `--flag=value` and * `--flag value` forms for user convenience. */ export declare function parseCliFlags(argv: readonly string[]): CliParseResult; /** * Usage string. Printed to stdout on `--help` (exit 0). Kept in sync with * the flag switch above — add a flag here AND in the parser; drift-grep * has no hook for this yet, so it's a shared human-managed contract. */ export declare function usage(): string; /** * Pre-loadConfig env injection. CLI flags beat env vars — the simplest way * to enforce that without restructuring `loadConfig` is to write the CLI * values INTO the matching env vars before loadConfig reads them. Mutation * is local to the current process; no child process inherits a different * env unless it does so deliberately via child_process.spawn env overrides. * * Returns a map describing the source of each resolved value, for the * startup source-log line requested in the brief. * * v2.2.1 L2 (Codex audit): source taxonomy widened to `"cli" | "env" | * "config" | "default"`. Pre-L2 config-file-won values were mislabeled as * "default" because the parser only saw CLI + env layers. We can't know * which keys the file sets without reading it here, so we pass a * `fileKeys` set (populated by the caller after `loadConfig` reads the * file) — keys present in the file AND not overridden by CLI/env are * labeled "config" instead of "default". */ export type ConfigSource = "cli" | "env" | "config" | "default"; export declare function applyCliToEnv(flags: CliFlags, env: NodeJS.ProcessEnv, fileKeys?: ReadonlySet): Record; //# sourceMappingURL=cli.d.ts.map