Documentation
    Preparing search index...

    Variable argsConst

    args: {
        string<Type = string>(
            options?: Partial<Omit<StringArgument<Type>, "type">>,
        ): <Key extends string, Target extends { [K in string]?: Type }>(
            target: Target,
            propertyName: Key,
        ) => void;
        spread<Type extends unknown = string[]>(
            options?: Partial<Omit<SpreadArgument<Type>, "type">>,
        ): <Key extends string, Target extends { [K in string]?: Type }>(
            target: Target,
            propertyName: Key,
        ) => void;
    } = ...

    Namespace for defining arguments using decorators.

    Arguments are positional parameters that commands accept from the CLI. They are parsed in the order they are defined and made available as properties on the command instance.

    Type Declaration

    • string: function
      • Define argument that accepts a string value

        Type Parameters

        • Type = string

        Parameters

        • Optionaloptions: Partial<Omit<StringArgument<Type>, "type">>

          Configuration options for the string argument

        Returns <Key extends string, Target extends { [K in string]?: Type }>(
            target: Target,
            propertyName: Key,
        ) => void

        export class MakeCommand extends BaseCommand {
        @args.string({ description: 'The entity name' })
        declare name: string

        @args.string({ description: 'Template type', required: false, default: 'default' })
        declare template?: string
        }
    • spread: function
      • Define argument that accepts a spread of values (variable number of arguments)

        Spread arguments collect all remaining positional arguments into an array. Only one spread argument is allowed per command and it must be the last argument.

        Type Parameters

        • Type extends unknown = string[]

        Parameters

        • Optionaloptions: Partial<Omit<SpreadArgument<Type>, "type">>

          Configuration options for the spread argument

        Returns <Key extends string, Target extends { [K in string]?: Type }>(
            target: Target,
            propertyName: Key,
        ) => void

        export class InstallCommand extends BaseCommand {
        @args.string({ description: 'Package manager' })
        declare manager: string

        @args.spread({ description: 'Package names to install', required: false })
        declare packages?: string[]
        }
        // Usage: node ace install npm lodash axios moment
        // manager = 'npm', packages = ['lodash', 'axios', 'moment']
    export class MakeCommand extends BaseCommand {
    @args.string({ description: 'Entity name' })
    declare name: string

    @args.spread({ description: 'Additional files', required: false })
    declare files?: string[]
    }