#!/usr/bin/env node
const e=require(`./getSpec-y1q2Fa6c.cjs`),t=require(`./src-DxujYdu0.cjs`);let n=require(`commander`);n=e.R(n);var r=`0.86.5`,i={"openapi-ts":`./bin/run.js`};const a=e=>e===`true`?!0:e===`false`?!1:e,o=(e,t)=>{for(let n of t){let t=e[n];if(typeof t==`string`){let r=a(t);delete e[n],e[n]=r}}return e},s=async()=>{let e=new n.Command().name(Object.keys(i)[0]).usage(`[options]`).version(r).option(`-c, --client <value>`,`HTTP client to generate [@hey-api/client-axios, @hey-api/client-fetch, @hey-api/client-next, @hey-api/client-nuxt, legacy/angular, legacy/axios, legacy/fetch, legacy/node, legacy/xhr]`).option(`-d, --debug`,`Set log level to debug`).option(`--dry-run [value]`,`Skip writing files to disk?`).option(`-e, --experimental-parser [value]`,`Opt-in to the experimental parser?`).option(`-f, --file [value]`,`Path to the config file`).option(`-i, --input <value>`,`OpenAPI specification (path, url, or string content)`).option(`-l, --logs [value]`,`Logs folder`).option(`-o, --output <value>`,`Output folder`).option(`-p, --plugins [value...]`,`List of plugins you'd like to use`).option(`--base [value]`,`DEPRECATED. Manually set base in OpenAPI config instead of inferring from server value`).option(`-s, --silent`,`Set log level to silent`).option(`--no-log-file`,`Disable writing a log file. Works like --silent but without suppressing console output`).option(`-w, --watch [value]`,`Regenerate the client when the input file changes?`).option(`--exportCore [value]`,`DEPRECATED. Write core files to disk`).option(`--name <value>`,`DEPRECATED. Custom client class name`).option(`--request <value>`,`DEPRECATED. Path to custom request file`).option(`--useOptions [value]`,`DEPRECATED. Use options instead of arguments?`).parse(process.argv).opts(),s;try{s=o(e,[`dryRun`,`experimentalParser`,`exportCore`,`logFile`,`useOptions`]),s.file&&(s.configFile=s.file,delete s.file),e.plugins===!0?s.plugins=[]:e.plugins?s.plugins=e.plugins:s.client&&(s.plugins=[`@hey-api/typescript`,`@hey-api/sdk`]),s.client&&(s.plugins.push(s.client),delete s.client),s.logs=s.logs?{path:s.logs}:{},s.debug||a(process.env.DEBUG)?(s.logs.level=`debug`,delete s.debug):s.silent&&(s.logs.level=`silent`,delete s.silent),s.logs.file=s.logFile,delete s.logFile,typeof e.watch==`string`&&(s.watch=Number.parseInt(e.watch,10)),Object.keys(s.logs).length||delete s.logs,(await t.r(s))[0]?.config.input.some(e=>e.watch&&e.watch.enabled)||process.exit(0)}catch{process.exit(1)}};s();
//# sourceMappingURL=run.cjs.map