#!/usr/bin/env node // Thin shim so the CLI is callable as `toolctrl-cli`. // The actual command tree lives in ../src/index.ts and is loaded via tsx in dev, // or via the compiled output once the build pipeline produces dist/index.js. import { fileURLToPath, pathToFileURL } from "node:url"; import { existsSync } from "node:fs"; import { dirname, resolve } from "node:path"; const __dirname = dirname(fileURLToPath(import.meta.url)); const distEntry = resolve(__dirname, "../dist/index.js"); const srcEntry = resolve(__dirname, "../src/index.ts"); const target = existsSync(distEntry) ? distEntry : srcEntry; const moduleUrl = pathToFileURL(target).href; const { runMain } = await import(moduleUrl); await runMain();