import { ToolName } from "./confluent/tools/tool-name.js"; import { TransportType } from "./mcp/transports/types.js"; import { KeyValuePairObject } from "properties-file"; /** * Thrown when Commander has already printed help or version text and the process * should exit cleanly (code 0). Callers catch this to call process.exit(0) * without conflating it with a real error. */ export declare class DisplayedCommandLineUsageError extends Error { constructor(); } export interface CLIOptions { envFile?: string; config?: string; transports: TransportType[]; allowTools?: string[]; blockTools?: string[]; listTools?: boolean; kafkaConfig?: KeyValuePairObject; disableAuth?: boolean; allowedHosts?: string[]; generateKey?: boolean; initConfig?: boolean; initOauthConfig?: boolean; oauth?: boolean; ccloudEnv?: "devel" | "stag" | "prod"; } /** * Get the package version from package.json * @returns Package version string */ export declare function getPackageVersion(): string; /** * Parse command line arguments into a structured CLIOptions object. * * Only minimally interprets the raw CLI input in order to populate CLIOptions: * 1. Will dereference and parse named files for tool allow/block lists. * 2. Will parse the kafka config properties file into an object. * * Does NOT load environment variables from the env file, nor does it load or * validate the YAML configuration file. * * @param argv - Array of command line arguments (e.g., process.argv) * @returns Structured CLIOptions object with parsed and validated values. * @throws Error if CLI arguments are invalid, if specified files cannot be read, or if file contents are malformed. */ export declare function parseCliArgs(argv: string[]): CLIOptions; /** * Parse a dotenv file, returning its entries as a `Record` and * (intentionally) writing the same entries into `process.env` with `override: * true` so preexisting shell-environment values are replaced. * * Two channels, one source. The return value is what mcp-confluent application * code consumes — fed into `buildConfigFromEnvAndCli` on the legacy env-var * path, and supplied as the env source for `${VAR}` interpolation inside YAML. * The `process.env` mutation exists for a different audience: **external * libraries** (OpenSSL via `SSL_CERT_FILE` / `NODE_EXTRA_CA_CERTS`, cyrus-sasl * via `SASL_PATH`, krb5 via `KRB5_CONFIG` / `KRB5CCNAME` / `KRB5_KTNAME`, * undici via `HTTPS_PROXY` / `HTTP_PROXY` / `NO_PROXY`, librdkafka transitively * through these) read `process.env` directly outside our control, and a user * supplying `-e` reasonably expects those settings to be honored. * * Do not "clean up" the side effect: application code is forbidden by lint * from reading `process.env` outside the bootstrap allowlist, but the linked * libraries that need this seed are unaffected by that rule. * * Throws if the file does not exist or `dotenv` returns an error. * * @param envFile Path to the environment file * @returns The parsed entries — also reflected into `process.env` */ export declare function loadDotEnvFile(envFile: string): Record; /** * Filters and returns a sorted list of enabled ToolNames based on CLI allow/block options. * * This function determines which tools should be enabled for the server by applying * the following logic: * 1. If allow list (`allowTools`) is non-empty, only those * tool names present in the allow list (and valid) will be enabled. Any invalid * tool names in the allow list are ignored and a warning is logged. * 2. If block list (`blockTools`) is non-empty, any tool * names present in the block list (and valid) will be removed from the enabled * set. Any invalid tool names in the block list are ignored and a warning is logged. * 3. If both lists are empty, all available tools are enabled. * * The returned list is always sorted alphabetically. * * @param allowTools - Array of tool names to explicitly allow/enable. If nonempty, only these tools will possibly * be enabled (subject to block list). If not provided or empty, all tools are initially * considered for enabling. * @param blockTools - Array of tool names to block. If nonempty, these tools will be disabled (even if * they are in the allow list). * * @returns An alphabetically sorted array of enabled ToolNames. */ export declare function getFilteredToolNames(allowTools: string[], blockTools: string[]): ToolName[]; /** * Loads configuration from a properties file * @param filePath - Path to the properties file * @returns configuration object */ export declare function parsePropertiesFile(filePath: string): KeyValuePairObject; //# sourceMappingURL=cli.d.ts.map