/** * CLI Entry Point */ import { Command } from "commander"; /** * Create Commander program instance */ export declare function createProgram(): Command; /** * Extract the subcommand name from argv (best-effort). * * Skips global options that take a value so things like `--library upgrade` * are not misread as the `upgrade` subcommand. The set of value-taking * options is derived from the Commander program itself, so it stays in sync * with the option definitions above. */ export declare function extractCommandName(argv: string[], program?: Command): string; /** * Best-effort detection of `--no-update-check` in argv, without relying on * Commander having parsed yet (we start the async check before parseAsync). */ export declare function hasNoUpdateCheckFlag(argv: string[]): boolean; /** * Rewrite `ref upgrade --version ` to `ref upgrade --version=`. * * The program has `.version(packageJson.version)` which registers a no-arg * `--version` flag at the root. Commander's parser consumes the root * `--version` before subcommand options, so the space-separated form is * caught by the root (prints + exits) instead of reaching `upgrade`'s * `--version `. The `=` form binds the value to the subcommand's * option and sidesteps the root flag. */ export declare function rewriteUpgradeVersionFlag(argv: string[]): string[]; /** * Main CLI entry point */ export declare function main(argv: string[]): Promise; //# sourceMappingURL=index.d.ts.map