Interface ResolvedCommand

Object containing details about the resolved command, the path to the command file, any parameters, and a function to resolve the next command, if any.

interface ResolvedCommand {
    command: CommandModule;
    commandName: string;
    commandPath: string;
    commandTokens: string[];
    params?: Params;
    remainingCommandString: string;
    resolveNext?: (() => Promise<ResolvedCommand>);
    subcommandsDir: string;
}

Properties

command: CommandModule

The command object associated with the resolved command.

commandName: string

The name of the resolved command.

commandPath: string

The path to the resolved command file.

commandTokens: string[]

The command tokens that were resolved.

params?: Params

The params associated with the resolved command.

remainingCommandString: string

The part of the command string that has not yet been resolved.

resolveNext?: (() => Promise<ResolvedCommand>)

A function to resolve the next command, if any, based on the remaining command string.

subcommandsDir: string

The path to the directory where the command's subcommands should live.