@faisalrmdhn08/allin-cli
Version:
A modern full-stack CLI tool based on Typescript designed to accelerate your app development process — setup your entire stack in one seamless command.
37 lines • 2.31 kB
JavaScript
import chalk from 'chalk';
import { __renewProjectName } from '../utils/string.js';
import { __config, program } from '../config.js';
import { __generateTextAscii, __gradientColor } from '../utils/ascii.js';
import { CreateCommand } from './commands/create.js';
export async function generateProgram() {
program.name(__config.appName.toLowerCase()).description(__config.appDesc);
program.option('-v, --version', `Action to get information about the current version of ${__gradientColor('Allin CLI')} tool.`, () => {
__generateTextAscii();
process.exit(0);
});
program
.command('create')
.option('--backend <backend>', 'Set default framework for backend project at first run.')
.option('--frontend <frontend>', 'Set default framework for frontend project at first run.')
.option('--name <name>', 'Set project name at first run.')
.option('-f, --force', 'Overwrite project that existed.', false)
.option('--author <author>', 'Add author name for the project.')
.option('--description <description>', 'Add description for the project.')
.option('-d, --dir <dir>', "Path destination directory to save the project template that you've created.", process.cwd())
.option('--li, --license <license>', 'Add a LICENSE file.')
.option('--ts, --typescript', 'Initialize project with TypeScript configuration.', false)
.option('--dk, --docker', 'Initialize project with docker configuration.', false)
.option('--git', 'Initialize git repo automatically.', false)
.option('--pm <pm>', 'Choose or switching default package manager of the project.', 'npm')
.helpOption('-h, --help', `Action to get more information about ${chalk.bold('create')} command.`)
.summary('Action to create new project.')
.description('Create new project on your own.')
.action(async (options) => {
const command = CreateCommand.instance;
command.create(options);
});
program.helpOption('-h, --help', `Action to get more information about ${__gradientColor('Allin CLI')}.`);
program.helpCommand('help [command]', `Action to get more information about ${__gradientColor('Allin CLI')} commands.`);
program.parse();
}
//# sourceMappingURL=program.js.map