/** * Cross-tool CLI flag currency (ADR-0021). * * The single source of truth for the common flags every tool's run command * shares (`--json`, `--cwd`, `--quiet`, `--verbose`, `--debug`, * `--report-to`/`--api-key`, `--open`). Each tool builds its command with * `applyCommonFlags(...)` for the shared flags and adds only its * genuinely tool-specific options by hand — so a flag's text/short-alias/default * is declared once and cannot drift (it already had: `--report-to` read three * different ways across the three tools before this registry). * * `commander` is referenced ONLY as a type (`import type`), matching the rest of * contracts: `applyCommonFlags` calls `.option(...)` on a `Command` instance the * caller passes in, so no runtime `commander` require lands in `dist`. The * package keeps `commander` as an optional peer dependency (see index.ts). */ import type { CommonFlagKey } from '@opensip-cli/core'; import type { Command } from 'commander'; export type { CommonFlagKey } from '@opensip-cli/core'; /** Canonical declaration of one common flag. */ export interface CommonFlagSpec { /** Commander flag string, including the short alias where canonical (`-v, --verbose`). */ readonly flags: string; /** Canonical description — the one source of truth for this flag's help text. */ readonly description: string; /** * Literal default applied via `.option(flags, description, default)`. Omitted * for value flags whose default is computed per-invocation (e.g. `cwd`'s * `process.cwd()`), which callers supply through `applyCommonFlags`'s * `overrides` argument. */ readonly defaultValue?: string | boolean; } /** * The canonical common-flag registry. Adding a tool means calling * {@link applyCommonFlags} with the relevant keys — never re-declaring a flag. */ export declare const commonFlags: Readonly>; /** * Apply the given common flags to a Commander command in registry order. * * `overrides` supplies per-invocation defaults for flags whose default is not a * literal — notably `cwd`, where callers pass `{ cwd: process.cwd() }`. An * override also wins over a spec's `defaultValue` when both are present. * * Returns the same `command` for chaining. No runtime `commander` dependency is * introduced — only methods on the passed-in instance are called. */ export declare function applyCommonFlags(command: Command, keys: readonly CommonFlagKey[], overrides?: Partial>): Command; /** * The flags every tool's run command MUST declare (the parity set enforced by * the `cross-tool-flag-parity` fitness check, ADR-0021). `open` is intentionally * NOT mandatory — only report-producing tools expose it. */ export declare const MANDATORY_COMMON_FLAGS: readonly CommonFlagKey[]; //# sourceMappingURL=cli-flags.d.ts.map