Flags: {
    boolean: (<T>(options?: Partial<BooleanFlag<T>>) => BooleanFlag<T>);
    custom: {
        <T, P>(defaults: Partial<OptionFlag<T[], P>> & {} & ({} | {})): FlagDefinition<T, P, {}>;
        <T, P>(defaults: Partial<OptionFlag<NotArray<T>, P>> & {} & ({} | {})): FlagDefinition<T, P, {}>;
        <T, P>(defaults: Partial<OptionFlag<NotArray<T>, P>> & {}): FlagDefinition<T, P, {}>;
        <T, P>(defaults: Partial<OptionFlag<T[], P>> & {}): FlagDefinition<T, P, {}>;
        <T, P>(): FlagDefinition<T, P, {}>;
    };
    directory: FlagDefinition<string, {}, {}>;
    duration: FlagDefinition<Duration, DurationFlagConfig, {}>;
    file: FlagDefinition<string, {}, {}>;
    integer: FlagDefinition<number, {}, {}>;
    option: {
        <T, P>(defaults: Partial<OptionFlag<ReadonlyElementOf<T>[], P>> & {} & ({} | {})): FlagDefinition<typeof defaults.options[number], P, {}>;
        <T, P>(defaults: Partial<OptionFlag<ReadonlyElementOf<T>, P>> & {} & ({} | {})): FlagDefinition<typeof defaults.options[number], P, {}>;
        <T, P>(defaults: Partial<OptionFlag<ReadonlyElementOf<T>, P>> & {}): FlagDefinition<typeof defaults.options[number], P, {}>;
        <T, P>(defaults: Partial<OptionFlag<ReadonlyElementOf<T>[], P>> & {}): FlagDefinition<typeof defaults.options[number], P, {}>;
    };
    optionalHub: FlagDefinition<Org, CustomOptions, {}>;
    optionalOrg: FlagDefinition<Org, CustomOptions, {}>;
    orgApiVersion: FlagDefinition<string, CustomOptions, {}>;
    requiredHub: FlagDefinition<Org, CustomOptions, {}>;
    requiredOrg: FlagDefinition<Org, CustomOptions, {}>;
    salesforceId: FlagDefinition<string, IdFlagConfig, {}>;
    string: FlagDefinition<string, CustomOptions, {}>;
    url: FlagDefinition<URL, CustomOptions, {}>;
} = ...

Type declaration

  • boolean: (<T>(options?: Partial<BooleanFlag<T>>) => BooleanFlag<T>)
      • <T>(options?): BooleanFlag<T>
      • A boolean flag. Defaults to false unless default is set to true.

        • allowNo option allows --no- prefix to negate boolean flag.

        Type Parameters

        • T = boolean

        Parameters

        • Optionaloptions: Partial<BooleanFlag<T>>

        Returns BooleanFlag<T>

  • custom: {
        <T, P>(defaults: Partial<OptionFlag<T[], P>> & {} & ({} | {})): FlagDefinition<T, P, {}>;
        <T, P>(defaults: Partial<OptionFlag<NotArray<T>, P>> & {} & ({} | {})): FlagDefinition<T, P, {}>;
        <T, P>(defaults: Partial<OptionFlag<NotArray<T>, P>> & {}): FlagDefinition<T, P, {}>;
        <T, P>(defaults: Partial<OptionFlag<T[], P>> & {}): FlagDefinition<T, P, {}>;
        <T, P>(): FlagDefinition<T, P, {}>;
    }
      • <T, P>(defaults): FlagDefinition<T, P, {}>
      • Create a custom flag.

        Type Parameters

        • T = string
        • P extends CustomOptions = CustomOptions

        Parameters

        • defaults: Partial<OptionFlag<T[], P>> & {} & ({} | {})

        Returns FlagDefinition<T, P, {}>

        type Id = string
        type IdOpts = { startsWith: string; length: number }

        export const myFlag = custom<Id, IdOpts>({
        parse: async (input, opts) => {
        if (input.startsWith(opts.startsWith) && input.length === opts.length) {
        return input
        }

        throw new Error('Invalid id')
        },
        })
      • <T, P>(defaults): FlagDefinition<T, P, {}>
      • Type Parameters

        • T = string
        • P extends CustomOptions = CustomOptions

        Parameters

        • defaults: Partial<OptionFlag<NotArray<T>, P>> & {} & ({} | {})

        Returns FlagDefinition<T, P, {}>

      • <T, P>(defaults): FlagDefinition<T, P, {}>
      • Type Parameters

        • T = string
        • P extends CustomOptions = CustomOptions

        Parameters

        • defaults: Partial<OptionFlag<NotArray<T>, P>> & {}

        Returns FlagDefinition<T, P, {}>

      • <T, P>(defaults): FlagDefinition<T, P, {}>
      • Type Parameters

        • T = string
        • P extends CustomOptions = CustomOptions

        Parameters

        • defaults: Partial<OptionFlag<T[], P>> & {}

        Returns FlagDefinition<T, P, {}>

      • <T, P>(): FlagDefinition<T, P, {}>
      • Type Parameters

        • T = string
        • P extends CustomOptions = CustomOptions

        Returns FlagDefinition<T, P, {}>

  • directory: FlagDefinition<string, {}, {}>
  • duration: FlagDefinition<Duration, DurationFlagConfig, {}>
  • file: FlagDefinition<string, {}, {}>
  • integer: FlagDefinition<number, {}, {}>
  • option: {
        <T, P>(defaults: Partial<OptionFlag<ReadonlyElementOf<T>[], P>> & {} & ({} | {})): FlagDefinition<typeof defaults.options[number], P, {}>;
        <T, P>(defaults: Partial<OptionFlag<ReadonlyElementOf<T>, P>> & {} & ({} | {})): FlagDefinition<typeof defaults.options[number], P, {}>;
        <T, P>(defaults: Partial<OptionFlag<ReadonlyElementOf<T>, P>> & {}): FlagDefinition<typeof defaults.options[number], P, {}>;
        <T, P>(defaults: Partial<OptionFlag<ReadonlyElementOf<T>[], P>> & {}): FlagDefinition<typeof defaults.options[number], P, {}>;
    }
      • <T, P>(defaults): FlagDefinition<typeof defaults.options[number], P, {}>
      • Create a custom flag that infers the flag type from the provided options.

        The provided options must be a readonly array in order for type inference to work.

        Type Parameters

        • T extends readonly string[]
        • P extends CustomOptions

        Parameters

        • defaults: Partial<OptionFlag<ReadonlyElementOf<T>[], P>> & {} & ({} | {})

        Returns FlagDefinition<typeof defaults.options[number], P, {}>

        export default class MyCommand extends Command {
        static flags = {
        name: Flags.option({
        options: ['foo', 'bar'] as const,
        })(),
        }
        }
      • <T, P>(defaults): FlagDefinition<typeof defaults.options[number], P, {}>
      • Type Parameters

        • T extends readonly string[]
        • P extends CustomOptions

        Parameters

        • defaults: Partial<OptionFlag<ReadonlyElementOf<T>, P>> & {} & ({} | {})

        Returns FlagDefinition<typeof defaults.options[number], P, {}>

      • <T, P>(defaults): FlagDefinition<typeof defaults.options[number], P, {}>
      • Type Parameters

        • T extends readonly string[]
        • P extends CustomOptions

        Parameters

        • defaults: Partial<OptionFlag<ReadonlyElementOf<T>, P>> & {}

        Returns FlagDefinition<typeof defaults.options[number], P, {}>

      • <T, P>(defaults): FlagDefinition<typeof defaults.options[number], P, {}>
      • Type Parameters

        • T extends readonly string[]
        • P extends CustomOptions

        Parameters

        • defaults: Partial<OptionFlag<ReadonlyElementOf<T>[], P>> & {}

        Returns FlagDefinition<typeof defaults.options[number], P, {}>

  • optionalHub: FlagDefinition<Org, CustomOptions, {}>
  • optionalOrg: FlagDefinition<Org, CustomOptions, {}>
  • orgApiVersion: FlagDefinition<string, CustomOptions, {}>
  • requiredHub: FlagDefinition<Org, CustomOptions, {}>
  • requiredOrg: FlagDefinition<Org, CustomOptions, {}>
  • salesforceId: FlagDefinition<string, IdFlagConfig, {}>
  • string: FlagDefinition<string, CustomOptions, {}>
  • url: FlagDefinition<URL, CustomOptions, {}>