import commander from "commander"; import fs from "fs"; import path from "path"; const program = commander.program; (async function () { const commandsDirPath = path.join(__dirname, "command"); const commandFileNames = fs.readdirSync(commandsDirPath); for (const commandFileName of commandFileNames) { const commandFileAbsolutePath = path.join(commandsDirPath, commandFileName); require(commandFileAbsolutePath).default(program); } await program.parseAsync(process.argv); })();