@capgo/cli
Version:
A CLI to upload to capgo servers
38 lines (37 loc) • 1.64 kB
TypeScript
/**
* Returns true if we're on macOS and can use the native file picker.
*/
export declare function canUseFilePicker(): boolean;
/**
* Open the macOS native file picker dialog filtered to .p8 files.
* Returns the selected file path, or null if the user cancelled.
* Non-blocking — uses async execFile so Ink spinners keep animating.
*/
export declare function openFilePicker(): Promise<string | null>;
export declare function openPackageJsonPicker(): Promise<string | null>;
export interface SaveFilePickerOptions {
prompt: string;
defaultName?: string;
defaultLocation?: string;
}
/**
* Open the macOS native "Save As…" dialog. Returns the chosen path, or null if
* the user cancelled. macOS prompts for overwrite confirmation natively, so
* callers do not need to re-confirm.
*/
export declare function openSaveFilePicker(opts: SaveFilePickerOptions): Promise<string | null>;
/**
* Open the macOS native file picker filtered to Android keystore files.
* Accepts .jks, .keystore, and .p12 extensions.
*/
export declare function openKeystorePicker(): Promise<string | null>;
/**
* Open the macOS native file picker filtered to Google Play service account
* JSON files. Used by the Android onboarding "import existing SA" path.
*
* Uses the official `public.json` Uniform Type Identifier rather than the raw
* `"json"` extension hint — AppleScript treats unrecognized strings as 4-char
* OSType codes, and the legacy OSType code for `"json"` does not match real
* `.json` files, which makes the dialog grey them all out.
*/
export declare function openServiceAccountJsonPicker(): Promise<string | null>;