Command: {
    action?: (args: ParsedArgs) => void;
    description: string;
    name: string;
    options?: CommandOption[];
    positionalArgs?: PositionalArgument[];
    subcommands?: Command[];
}

Represents a CLI command with its options, arguments, and behavior.

Commands can have:

  • Options (--flag style arguments)
  • Positional arguments
  • Subcommands for nested functionality
  • An action to execute
const deployCommand: Command = {
name: 'deploy',
description: '🚀 Deploy your application',
options: [{
name: 'env',
description: 'Target environment',
defaultValue: 'dev'
}],
action: (args) => {
console.log(`🚀 Deploying to ${args.env}...`);
}
};