/** * Shared context builder for CLI commands * * Creates FraseApiClient from CLI options (--api-key, --api-url) * with proper auth resolution order. */ import { FraseApiClient } from "@frase/core"; import type { Config } from "@frase/core"; import type { Command } from "commander"; /** * Configure a parent command to show subcommand usage strings * in its help listing instead of generic `[options]`. */ export declare function configureParentHelp(cmd: Command): Command; /** * CLI output options passed to every command */ export interface OutputOpts { json?: boolean; compact?: boolean; } /** * Get config from CLI options (walks up parent commands for global opts) */ export declare function getConfig(cmd: Command): Config; /** * Create API client from CLI command context */ export declare function createClient(cmd: Command): { client: FraseApiClient; config: Config; }; /** * Run a command action with automatic client setup and teardown */ export declare function withClient(cmd: Command, fn: (client: FraseApiClient, config: Config) => Promise): Promise; /** * Get output options from command */ export declare function getOutputOpts(cmd: Command): OutputOpts; /** * Print output and exit */ export declare function print(text: string): void; /** * Print error and exit */ export declare function printError(message: string): never; /** * Catch handler for command errors — handles non-Error throws gracefully. * Use as: `.catch(catchError)` instead of `.catch((e) => printError(e.message))` */ export declare function catchError(e: unknown): never; //# sourceMappingURL=context.d.ts.map