anl
Version:
FE command line tool
1 lines • 2.1 kB
JavaScript
const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./package.cjs`),n=require(`./git-local-config/index.cjs`),r=require(`./skill-init/index.cjs`),i=require(`./standard/lint-init.cjs`),a=require(`./swagger-codegen/index.cjs`);let o=require(`commander`),s=require(`inquirer`);s=e.__toESM(s),o.program.version(`${t.version}`,`-v --version`).usage(`<command> [options]`),o.program.command(`type`).description(`auto interface`).option(`-s, --show <what>`,`show interface list after generation: miss | gen`).option(`-f, --format [config]`,`enable prettier formatting after generation; optionally specify a prettier config file path (e.g. --format .prettierrc.mjs)`).option(`-l, --log-level <level>`,`set log output level: silent | error | warn | info | verbose`).option(`-S, --service <names>`,"only regenerate the specified swagger service(s); comma-separated. Match by `name` (preferred) or `apiListFileName` without extension. Other services are kept untouched.").action(e=>{let t=(e.show??``).toLowerCase().trim(),n=t===`miss`||t===`missing`||t===`m`||t===`exclude`||t===`x`?`miss`:t===`gen`||t===`generated`||t===`g`||t===`include`||t===`i`?`gen`:void 0,r=e.service?e.service.split(`,`).map(e=>e.trim()).filter(Boolean):void 0;new a.Main().initialize(n,e.format,e.logLevel,r).catch(e=>{console.error(e)})}),o.program.command(`lint`).description(`install linting tools (eslint, stylelint, prettier, commitlint, vscode)`).action(()=>i.lintHandle()),o.program.command(`git`).description(`config git Local custom command`).action(async()=>{let{features:e}=await s.default.prompt([{type:`checkbox`,name:`features`,message:`Select the required Git features (multi-select):`,choices:[{name:`gitflow standard branch creation`,value:`gitflow`},{name:`automatically set commit subject`,value:`commitSubject`},{name:`custom git command`,value:`customGitCommand`}],pageSize:10}]);n.gitHandle(e).catch(e=>{console.error(e)})}),o.program.command(`skill`).description(`initialize an agent skill into the current project`).action(()=>{r.skillHandle().catch(e=>{console.error(e)})}),o.program.parse(process.argv);