import BaseCommand, { OptionType, Command } from 'sosise-core/build/Command/BaseCommand'; export default class %name% extends BaseCommand { /** * Command name */ protected signature: string = 'example:command'; /** * Command description */ protected description: string = 'This is a example command'; /** * When the command is executed, prevent it from double execution */ protected singleExecution: boolean = false; /** * Command options */ protected options: OptionType[] = [ // Options can be boolean { flag: '-d, --debug', description: 'Show debug information', required: false }, // Options can pass some values { flag: '-s, --since ', description: 'Report since', default: '29.12.2020', required: false }, ]; /** * Execute the console command */ public async handle(cli: Command): Promise { // Access options via cli.opts() const options = cli.opts(); // Check if the debug option is provided if (options.debug) { console.log('Debug option provided'); } console.log('Example export since ' + options.since); } }