UNPKG

@flowcore/cli-plugin-config

Version:
22 lines (21 loc) 987 B
import { Command, type Interfaces } from "@oclif/core"; import { cliui } from "@poppinss/cliui"; import { CliConfiguration } from "./utils/config.util.js"; import { Logger } from "./utils/logger.util.js"; export type BaseFlags<T extends typeof Command> = Interfaces.InferredFlags<(typeof BaseCommand)["baseFlags"] & T["flags"]>; export type BaseArgs<T extends typeof Command> = Interfaces.InferredArgs<T["args"]>; export declare abstract class BaseCommand<T extends typeof Command> extends Command { static baseFlags: { profile: Interfaces.OptionFlag<string, Interfaces.CustomOptions>; }; protected args: BaseArgs<T>; protected cliConfiguration: CliConfiguration; protected flags: BaseFlags<T>; protected logger: Logger; protected ui: ReturnType<typeof cliui>; protected catch(err: { exitCode?: number; } & Error): Promise<unknown>; protected finally(_: Error | undefined): Promise<unknown>; protected init(): Promise<void>; }