/** * CLI entry point * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ import { CLI, CLIOptions, getPackageJson } from 'inquirerer'; import { commands } from './commands'; if (process.argv.includes('--version') || process.argv.includes('-v')) { const pkg = getPackageJson(__dirname); console.log(pkg.version); process.exit(0); } // Check for --tty false or --no-tty to enable non-interactive mode (noTty) const ttyIdx = process.argv.indexOf('--tty'); const noTty = (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); const options: Partial = { noTty, minimistOpts: { alias: { v: 'version', h: 'help' } }, }; const app = new CLI(commands, options); app.run().catch((e) => { console.error('Unexpected error:', e); process.exit(1); });