#!/usr/bin/env node // KOB CLI v2 launcher. // Prefers a compiled binary if present; otherwise runs the TS entry via the // installed runtime (bun or tsx). import { spawnSync } from 'node:child_process'; import { fileURLToPath } from 'node:url'; import { dirname, join } from 'node:path'; const here = dirname(fileURLToPath(import.meta.url)); const entry = join(here, '..', 'src', 'index.ts'); const runner = process.versions.bun ? 'bun' : 'tsx'; const res = spawnSync(runner, [entry, ...process.argv.slice(2)], { stdio: 'inherit' }); process.exit(res.status ?? 0);