UNPKG

@elora-cloud/elora-cli

Version:
14 lines (12 loc) 944 B
import process from 'node:process'; import { Command } from 'commander'; import pkg from '../package.json.mjs'; import { changeLog } from './commands/change-log/index.mjs'; import { commitLint } from './commands/commit-lint/index.mjs'; import { release } from './commands/release/index.mjs'; const program = new Command('elora'); program.usage('<command> [options]').helpOption('-h,--help', 'elora cli 帮助文档').version(pkg.version, '-v,--version', '查看版本信息'); program.command('changelog').argument('[nextArgs...]', 'extra arguments for the dev command').description('生成日志工具').action(changeLog); program.command('commit-lint <gitParams>').description('代码提交规范').action(commitLint); program.command('release').argument('[nextArgs...]', 'extra arguments for the dev command').description('版本发布').option('-t,--tag <tag>', '需要发布的版本类型').action(release); program.parse(process.argv);