#!/usr/bin/env bun function printUsage(): void { console.error(`Usage: bun scripts/run.ts translate [target-language] [output-path] [--dry-run] Commands: translate [target-language] [output-path] Config: GEMINI_API_KEY= `); } async function main(): Promise { const positionals: string[] = []; let dryRun = false; for (const arg of process.argv.slice(2)) { if (arg === '--dry-run') { dryRun = true; } else if (arg === '-h' || arg === '--help') { printUsage(); process.exit(0); } else { positionals.push(arg); } } if (positionals.length < 1) { printUsage(); process.exit(1); } const { run } = await import('../src/index.ts'); const result = await run(positionals[0] as 'translate', positionals.slice(1), dryRun); console.log(JSON.stringify(result, null, 2)); } main().catch((err) => { console.error(JSON.stringify({ status: 'failed', error: err instanceof Error ? err.message : String(err) }, null, 2)); process.exit(1); });