()
| 55 | } |
| 56 | |
| 57 | async function buildLightweightYargsApp(): Promise<ReturnType<typeof import('yargs').default>> { |
| 58 | const yargs = (await import('yargs')).default; |
| 59 | const { hideBin } = await import('yargs/helpers'); |
| 60 | |
| 61 | return yargs(hideBin(process.argv)) |
| 62 | .scriptName('') |
| 63 | .strict() |
| 64 | .help() |
| 65 | .option('socket', { |
| 66 | type: 'string', |
| 67 | describe: 'Override daemon unix socket path', |
| 68 | hidden: true, |
| 69 | }) |
| 70 | .option('log-level', { |
| 71 | type: 'string', |
| 72 | describe: 'Set log verbosity level', |
| 73 | choices: ['none', 'error', 'warn', 'info', 'debug'] as const, |
| 74 | coerce: coerceLogLevel, |
| 75 | default: 'none', |
| 76 | }) |
| 77 | .option('style', { |
| 78 | type: 'string', |
| 79 | describe: 'Output style (normal is detailed; minimal is compact MCP-like output)', |
| 80 | choices: ['normal', 'minimal'] as const, |
| 81 | default: 'normal', |
| 82 | }) |
| 83 | .option('file-path-render-style', { |
| 84 | type: 'string', |
| 85 | describe: 'Render file artifacts as a compact tree or labeled list in text output', |
| 86 | choices: ['tree', 'list'] as const, |
| 87 | }) |
| 88 | .middleware((argv) => { |
| 89 | const level = argv['log-level'] as LogLevel | undefined; |
| 90 | if (level) { |
| 91 | setLogLevel(level); |
| 92 | } |
| 93 | }); |
| 94 | } |
| 95 | |
| 96 | async function runInitCommand(): Promise<void> { |
| 97 | const { registerInitCommand } = await import('./cli/commands/init.ts'); |
no test coverage detected