@ideascol/cli-maker
Version:
A simple library to help create CLIs
35 lines (34 loc) • 1.53 kB
TypeScript
import { Command, SetupCommandOptions, SetupStep, LoadConfigOptions } from './interfaces';
/**
* Generates an interactive "setup" command to configure global variables for the CLI.
* Stores the resulting config in ~/.cli-maker/<cliName>-config.json by default.
*/
export declare function createSetupCommand(cliName: string, options: SetupCommandOptions): Command;
/**
* Helper to read the setup config programáticamente.
*/
export declare function loadSetupConfig(cliName: string, steps: SetupStep[], options?: LoadConfigOptions): Record<string, any>;
/**
* Helper to get the raw setup config without decryption.
* Use this for non-sensitive values. For Password fields, use loadSetupConfig with steps and passphrase.
*/
export declare function getRawConfig(cliName: string, options?: {
configFileName?: string;
}): Record<string, any>;
/**
* Helper to get a specific config value from the setup config.
* This is a simplified version that doesn't require steps and reads the raw config.
* Note: Password fields will remain encrypted/encoded unless you use loadSetupConfig with steps and passphrase.
*/
export declare function getConfigValue(cliName: string, key: string, options?: {
configFileName?: string;
}): any;
/**
* Prompts the user for hidden input (password-like).
* The input is not displayed on the screen.
*/
export declare function hiddenPrompt(prompt: string): Promise<string>;
/**
* Prompts the user for visible input.
*/
export declare function prompt(question: string): Promise<string>;